• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Delay on tap (iOS)

D

Danr96

Guest
So I have a game where I switch sides using this code:

if(mouse_check_button_pressed(mb_left) && (mouse_x < room_width / 2) && playerLeft = 0 && grounded) {
playerLeft = 1;
playerRight = 0;
x = (room_width / 2) - 66;
//image_xscale = 1;
}

if(mouse_check_button_pressed(mb_left) && (mouse_x > room_width / 2) && playerRight = 0 && grounded) {
playerRight = 1;
playerLeft = 0;
x = (room_width / 2) + 66;
//image_xscale = -1;
}

Then I have the ability to jump on each side using this code:

if(mouse_check_button_pressed(mb_left) && (mouse_x < room_width / 2) && jumps = 2 && playerLeft == 1) {
jumps -= 1;
horizontalSpeed = -jumpSpeed;
} else if(mouse_check_button_pressed(mb_right) && (mouse_x < room_width / 2) && jumps = 1 && playerLeft == 1) {
jumps -=1;
horizontalSpeed = -jumpSpeed2;
}
if(mouse_check_button_pressed(mb_left) && (mouse_x > room_width / 2) && jumps = 2 && playerRight == 1) {
jumps -= 1;
horizontalSpeed = jumpSpeed;
} else if(mouse_check_button_pressed(mb_right) && (mouse_x > room_width / 2) && jumps = 1 && playerRight == 1) {
jumps -=1;
horizontalSpeed = jumpSpeed2;
}

When on both sides it allows you to jump twice.. But when you switch side and try to jump instantly there is a delay of about 1 second.. I was hoping someone would be able to help me resolve the issue.
 
Top