Knockback enemy based off of direction sprite is facing

Posted by pengume on Game Development See other posts from Game Development or by pengume
Published on 2011-03-13T09:20:54Z Indexed on 2011/03/13 16:17 UTC
Read the original article Hit count: 181

Filed under:

Hey Everyone,

Today I am trying to make it so if I hit the enemy then the enemy well be knocked backwards in the direction the sprite is facing. I am rotating the sprite around 360 degrees using a joystick on the screen and wanted to know the best practice or ways to accomplish this. I have come up with a few ideas but none of them make use of the sprites angle he is facing just a check to see if I hit the bottom then move him upward and so forth. I am just stumped on how to apply the sprites angle to the enemies x and y coordinate and move him accordingly. Has anyone tried this and have suggestions or things to look for?

Thanks in advance.

© Game Development or respective owner

Related posts about android