i want to make a flappy bird game, and i want to know how to make a timer that starts when the player presses the screen, the bird (or squid in my case) will start to go up and when the timer ends it will start to go down again.
here is the code
batch.begin();
//ignore this part
batch.draw(Assets.sprite_back,BackX ,0);
batch.draw(Assets.sprite_back2,BackX2 ,0);
//this is the squid
batch.draw(Assets.sprite_squiddy,10 ,squiddyY);
batch.end();
}
public void generalUpdate(){
//ignore
BackX -= 1;
BackX2 -= 1;
//look at this
squiddyY -=4;
//continue ignoring
if(BackX<=-480){
BackX = 480;
}
if(BackX2<=-480){
BackX2 = 480;
}
//this is the part we need
if(Gdx.input.justTouched()){
squiddyY += 100;
}
}
so actually now if you press it goes automatically up and i want him to go there smoothly
i hope i explained myself good enough.
oh yea and if there is a better way to do it please tell me