Question: 5. Consider the following code fragments which initialize and update variables for a small sprite moving in an unusual gravitational field across a 200 by

 5. Consider the following code fragments which initialize and update variables

5. Consider the following code fragments which initialize and update variables for a small sprite moving in an unusual gravitational field across a 200 by 200 pixel window. //Initialization (run once) int x = 180; int y = 20; int dx = -20; int dy = 20; 1/ Position and Velocity Update (run each frame) x += dx; y += dy; dy -= 10; a)(4 pts) Where on the window (i.e. top-left comer, bottom edge, etc.) is the sprite initially located? b)(4 pts) Which direction is the sprite initially moving? c)(5 pts) Which boundary (top, bottom, right, or left side) will the sprite run into first

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!