Circle 1: When the program starts, initialize X Velocity variable to 0 so the sprite is not moving. If the left arrow key is pressed then the sprite will speed up and move left until it reaches a limit of 7. This stops the sprite from infinitely accelerating. While the left key is not being pressed it will lose speed and decelerate.
Circle 2: Initialize the Gravity variable and continuously decrease it by 1.
No comments:
Post a Comment