Hi all,
I modify the invader exemple here, and I wanted to make it mobile friendly.
I add “button” :
boutonGauche = game.add.button(0, game.world.height - 60, ‘bouton-gauche’, bougerGauche);
boutonDroite = game.add.button(game.world.width - 64, game.world.height - 60, ‘bouton-droit’, bougerDroite);
boutonFeu = game.add.button(game.world.centerX - 32, game.world.height - 60, ‘bouton-feu’, fireBullet);
With this fonction :
function bougerGauche() {
player.x -= 5;
}
function bougerDroite() {
player.x += 5;
}
But nothing append, the animation restart each time I press on screen.
Can you help me please ?
Script is here : https://www.team-azerty.com/html/1erAvril/covid-19/js/invaders-reloaded.js