开发者

Walkable sprite help

开发者 https://www.devze.com 2023-02-17 13:18 出处:网络
I’m trying to make a sprite that is stationary at the start but once you click somewhere on the screen, it should move to that point

I’m trying to make a sprite that is stationary at the start but once you click somewhere on the screen, it should move to that point automatically开发者_C百科 in a straight line, creating the walking effect. How do I do this?


Um, your question is a little vague, and therefore hard to answer. Generally speaking, you can make a translate animation as described here: http://developer.android.com/reference/android/view/animation/TranslateAnimation.html Or, you can just do the drawing yourself: record the location of the touch event, interpolate some positions between that location and your sprite's starting position, and draw some frames yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号