Fedia

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. How to call a function correctly checkDown ? Now it shows an error that this function was not found. main.js function checkDown() { if (CAN_CLICK) { CAN_CLICK = false; last_pointer_position.x = game.input.activePointer.worldX; last_pointer_position.y = game.input.activePointer.worldY; setTimeout(function () { CAN_CLICK = true; }, 200) } }; game = new Phaser.Game(_GLOBAL.Width, _GLOBAL.Height, Phaser.CANVAS, 'game'); game.state.add('menu', gameCreate); game.state.start('menu'); gameCreate.js var gameCreate = { preload: function () { } create: function() { var self = this; this.game.input.onDown.add(self.checkDown, this); }
  2. I do everything by the example : this.pauseBtn.on('pointerdown', function (event) { timer = this.time.addEvent({ delay: 10000, callback: hidePopup, callbackScope: this}); }); When compiling it issues an error : Uncaught TypeError: Cannot read property 'addEvent' of undefined. How to fix it?