简体   繁体   中英

How to animate object without Open GL ES?

I am trying to make the movement of my snake smooth. Right now the movement is jumpy. This is how i have him moving....

public void advance() {
    SnakePart head = parts.get(0);               

    int len = parts.size() - 1;
    for(int i = len; i > 0; i--) {
        SnakePart before = parts.get(i-1);
        SnakePart part = parts.get(i);
        part.x = before.x;
        part.y = before.y;
    }

So basically i have it set to update every .5 seconds and advance one coordinate. Is there a way for me to make him move smoothly at one coordinate over .5 seconds without having to use Open GL ES?

如果未通过手指点击拖动“视图”对象,则可以尝试使用TranslateAnimation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM