Hi!
How can I make a object move in any angle in a 2d plane? Example: Start on the upper left and go to the lower right. Go and return, and so on.
Thx!!
2D Movement
-
Conquistador
- Posts: 340
- Joined: Wed Sep 28, 2005 4:38 pm
- Location: Canada, Eh!
You should look at some of the 2D games or projects in the projects announcement forum, they'll have examples how to do this. Generally, you'll have to update the objects position every frame, figuring out the new position should be done using vectors, and a little math. Check here for some useful math tips. I had something like this for an old pong game I made a while ago, but I don't have it anymore.
Royal Hamilton Light Infantry - http://www.rhli.ca
Paris/Port Dover Pipes'n Drums - http://www.parisdover.ca
Paris/Port Dover Pipes'n Drums - http://www.parisdover.ca