小编Guy*_*ero的帖子

顺利移动LibGdx

我正试着做这件事:

当用户按一次键时,精灵在某些像素上平滑移动.但它只是"传送"到这个位置.这是代码:

int co = 0;
Vector2 ppos=new Vector2(x,y);
    if (Gdx.input.isKeyJustPressed(Keys.A)){
        while (co < 33) {
                        batch.begin();
                        ppos.y += Gdx.graphics.getDeltaTime()*5;
                        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
                        batch.draw(Splayer, ppos.x, ppos.y); //Splayer is a sprite
                        batch.end();
                        co++;
                        out(co+"");
                    }
    }
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

java rendering libgdx

2
推荐指数
1
解决办法
755
查看次数

标签 统计

java ×1

libgdx ×1

rendering ×1