Intrée simple pour les jeux javascript
document.body.addEventListener("keydown", function (e) {
switch (e.key) {
case ' ':
flappyBird.velocity.y = -jumpPower
break
case 'Enter':
if(!gameStarted){
gameStarted = true
render()
}
break
default:
break
}
})
Himanshu Jangid