ismaPC95

Members
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by ismaPC95

  1. ismaPC95

    GAMEPAD JUST DOWN

    Hello guys, how can I control the download event with a gamepad? I just want an action while pressing the button. To do the same action, I'm going to press the button again. I need this action, but with a gamepadd button. Tahnk you all (Phaser.Input.Keyboard.JustDown(cursors.up) //the gamepad pad = this.input.gamepad.getPad(0);
  2. ismaPC95

    HOW CAN I DESTROY AN SPRITE?

    npcplayerUno = this.physics.add.sprite(800, 450, 'enemy').setScale(0.2); npcplayerUno.setBounce(0.1); npcplayerUno.setCollideWorldBounds(true); this.physics.add.collider(player, npcplayerUno, killEnemy, null, this); //TRY TO DO AN IA //pasar otra variable por parametro que sea la del enemigo en cuestion, por si se realiza con varios if(npcplayerUno!=undefined){ if(player.body.position.x<npcplayerUno.body.position.x){ setTimeout(function(){/*npcplayerUno.body.position.x=-1;*/ npcplayerUno.setVelocityX(-95); npcplayerUno.anims.play('moveEnemyLeft', true); },500); }else if(player.body.position.x>npcplayerUno.body.position.x){ setTimeout(function(){/*npcplayerUno.body.position.x=+1;*/ npcplayerUno.setVelocityX(95); npcplayerUno.anims.play('moveEnemyRight', true); },500); }else{ npcplayerUno.setVelocityX(0); npcplayerUno.anims.stop(); } } function killEnemy(player, npcplayerUno){ if(npcplayerUno.body.touching.up && player.body.touching.down){ player.setVelocityY(-350); npcplayerUno.setVelocityX(0); npcplayerUno.scaleY=0.12; //npcplayerUno.destroy(); } }
  3. ismaPC95

    HOW CAN I DESTROY AN SPRITE?

    How can I do that check? Because I have tried many things but I can not omit the mistake. Thanks for the quick reply.
  4. Im developing a game with phaser and need server and client parts. Then i need know if is posiblle. Thank you.
  5. You need create a new variable lastDirection. Then how this be execute 60 times per second in the update function, you need save each click and save the last direction. Finally you should compare if the last direction, was left or right and use one animation o another. (Previously created)