Rotating a png image representing a unit in a game
I am using png's in my tower defense game. How would I rotate a picture so it follows the movement of another picture (lik开发者_如何学Ce a turret always pointing at a target)?
Look into the AffineTransform
class. The rotate
method is what you're looking for. Here's an example!
If you've got some other specific game-development-related questions, there's a Game Development StackExchange site too.
精彩评论