Hello, so I’m learning html5 game programming and I’m now programming a game and I have an issue with simultaneous keydown
for example I want here to move the plane with the arrows while firing with space
I need help plz
Thanks !
function fire(event){
if (event.keyCode == 32){
bullets.push({
bulletx:planex+90,
bullety:canvas.height-120
});
}
}
function moveplane(event) {
if (event.keyCode == 39) {
if (planex > canvas.width-200){planex=planex;
}
else
{
planex=planex+planespeed;
}
}
if (event.keyCode == 37) {
if (planex canvas.width-200){planex=planex;
// }
// else
// {
// planex=planex+planespeed;
// }
// }
}