vanni784

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. I know i can do that, but i wanna call a function to do that, do you have an idea how to properly call the function?
  2. var config = { type: Phaser.AUTO, width: 800, height: 600, physics: { default: 'arcade', arcade: { gravity: { y: 400 }, debug: false, setBounds: true } }, // gravity: {y:400}, scene: { preload: preload, create: create, update: update, collideaa: collideaa } }; function create(){ ---some codes here-- } function update(time, delta) { if(gameoverID == false){ if(this.boy.y > this.cameras.main.height || this.boy.y <= 0) { // collide(); this.events.on(collideaa(), this); //collideaa(); //this.collideaa(); } } } function collideaa() { this.physics.pause(); } my function in update doesnt work. well actually it somehow works but after it is passed to the function but it says that the pause doesnt work. When i try other methods of using the function like the code below, it apparently works properly function create(){ this.physics.add.collider(this.boy, this.pipes, collideaa, null, this); }