please format code with </> button * homework policy * asking questions
i don’t know how i can not leave the last button on read, so let the image doing two movments at the same time. i mean i don’t know how the image can jump and go straight or back either at the same time. i’m using the arrows and not wasd and to jump the space bar.
if we try to go right and suddendly we need to go left (so we keep the right arrow pressed and we press and release the left arrow) our image would continue on the left side even if we’re still pressing the right arrow. we think it’s because processing keeps reading the last key pressed.
if (keyPressed){
if (keyCode==RIGHT){
marioX+=3;
}
if (keyCode==LEFT){
marioX-=3;
}
}