4
AssignmentMultiple Choice

Visual Python

Question 4 • SC-Fundamentals of Computing - Content Recovery - Design & Development

Which line of code moves the ball to the left?

Answer
A
myBall.pos.z = myBall.pos.z - 2
B
myBall.pos.x = myBall.pos.x - 1
C
myBall.pos.y = myBall.pos.y - 2
D
myBall.pos = myBall.pos - 1

Explanation

In a typical coordinate system, left and right are along the x-axis. Subtracting 1 from myBall.pos.x moves the ball in the negative x direction, which is left. Choice B, “myBall.pos.x = myBall.pos.x - 1,” does this.

AI-written and checked against the verified answer.

Previous
Next