Which line of code moves the ball down?
Understand the Problem
The question is asking which line of code will move the ball downward in a 3D coordinate system. To solve it, we need to determine how each of the provided code snippets alters the position of 'myBall' and which one correctly decreases the y-coordinate, thus moving the ball down.
Answer
myBall.pos.y = myBall.pos.y + 2
The line of code that moves the ball down is myBall.pos.y = myBall.pos.y + 2
.
Answer for screen readers
The line of code that moves the ball down is myBall.pos.y = myBall.pos.y + 2
.
More Information
Adding to the y-coordinate increases the vertical position, moving the object downward if the origin (0,0) is at the top-left of the screen, which is common in computer graphics.
Tips
A common mistake is decreasing the y-coordinate, which would move the object upward.
Sources
AI-generated content may contain errors. Please verify critical information