Elvis

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. Hi, first of all: thank you guys so far. I'm reading the text about "this" provided by symof. Intel XDK also creates a second file called app.js with this code: (function () { /* globals Phaser:true, BasicGame: true */ var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'game'); game.state.add('Game', BasicGame.Game); game.state.start('Game'); })(); so, I'm working with 2 files and it confuses me. I'll try Chazlodian's approach and post here the results.
  2. Thank you for the link. Actually, the problem is in this line: this.game.time.events.add(Phaser.Timer.SECOND * 6,1,BasicGame.Game.prototype.happyMsgSystem,this) the button is commented If I try this.game.time.events.add(Phaser.Timer.SECOND * 6,1, happyMsgSystem,this) or this.game.time.events.add(Phaser.Timer.SECOND * 6,1, happyMsgSystem) or game.time.events.add(Phaser.Timer.SECOND * 6,1, happyMsgSystem,this) the error message persists Thanks Elvis
  3. Hi, I'm a Phaser beginner. I'm using IntelXDK + Phaser.io theme (version 2.6.1). I'm trying to user a simple time event to stop an animation after 6 seconds. I think it is because the notation name: function () {} provided by intelXDK model that I'm using but I'm not sure. PS: If I use only the name of the function (instead of BasicGame.Game.prototype.happyMsgSystem), it doesn't work. The code: BasicGame = { }; BasicGame.Game = function (game) { }; BasicGame.Game.prototype = { preload: function () { this.load.spritesheet('button', 'asset/planet3.png', 59, 58,6); this.load.spritesheet('robot', 'asset/robot/robot-sprite.png', 587, 587,5); }, create: function () { //this.button = this.game.add.button(this.game.world.centerX - 95, 400, 'button', BasicGame.Game.prototype.happyMsgSystem, this, 2, 1, 0); this.game.time.events.add(Phaser.Timer.SECOND * 6,1,BasicGame.Game.prototype.happyMsgSystem,this); }, happyMsgSystem: function () { this.robot.animations.add('happyMsg', [1,2], 2, true); this.robot.play('happyMsg'); }, };
  4. This topic (the question of the author and the answer of jpdev) helped me a lot!!!! thank you guys