Move sprite in the direction it is facing?

Posted by rphello101 on Game Development See other posts from Game Development or by rphello101
Published on 2012-09-24T19:30:40Z Indexed on 2012/09/24 21:50 UTC
Read the original article Hit count: 176

Filed under:
|
|
|
|

I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction it is supposed to. When I hit "forwards", the sprite doesn't necessarily move towards the mouse. I'm sure there has to be some standard code for this since many games use this style of motion. Can anyone help me out with what the trig is supposed to be? Thanks

© Game Development or respective owner

Related posts about java

Related posts about sprites