samedi 11 avril 2015

Making a ball "chase" another ball?


Vote count:

-2




I have a game I'd like to make another game mode and the mode would work as such:


The user has a ball (a View that is a circle) in the center of the screen. The user must move the ball away from the center to start. Once the user moves away from the center another ball colored red spawns and "chases" the ball the user is moving. (The user moves their ball by tilting the device and code in a Timer updates the BallView according to accelerometer data).


So I propose to have a mechanism that saves past x and y position values of the ball and when the red ball initially spawns, set that ball's position to the user's ball's past position. As the game progresses I plan to make that update happen faster and faster to make the game harder and harder.


So how would I go about this task? How do I save a ball's past position and in a way where I can control the update speed of the red ball to make the game harder?



asked 6 mins ago







Making a ball "chase" another ball?

Aucun commentaire:

Enregistrer un commentaire