Hi,
I am currently working on a little android game called floor runner. The idea is your a stick man and you just have to keep away from objects trying to kill you. Very simple. Currently I have some base code in place and very bad graphics. I am looking for someone to create some minimlistic but good looking art, if they want. I will start to post screen shots when im making good progress. This is just the start of the post.
I have a question on how to add double jumping into the game, below is the code I use for jumping.
public void update(float delta) {
if(jumping) {
velocity.y = -100;
jumping = false;
}
if(position.y > originalY){
position.y = originalY;
canJump = true;
}else{
canJump = false;
velocity.add(gravity.cpy().scl(delta));
}
position.add(velocity.cpy().scl(delta));
collisionBox.x = position.x + 3;
collisionBox.y = position.y + 1;
}
public void onClick(){
if(isAlive){
if(!jumping && canJump == true){
jumping = true;
canJump = false;
}
}
}