Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

applyForce as long as display is pressed

$
0
0

In my project I have my main character body. I want it to move down on the y-axis as long as the screen is pressed. I tried it with

public boolean touchUp(int screenX, int screenY, int pointer, int button) {
        jetski.applyForce(new Vector2(0,-1000), jetski.getWorldCenter(), true);
        return true;
    }

but that does it only once.


Viewing all articles
Browse latest Browse all 434

Trending Articles