Jump to content

Search the Community

Showing results for tags 'init'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Does anyone know how to pass data into the game scene in Phaser 3 as you could do in Phaser 2 when started a state? game.state.start('Game', true, true, { data: 'this is some initial config' }); Phaser 3 Scene was Phaser 2 State, which you could provide parameters, the 2-3rd was as i remember caching, the 4th could be and data, which became available in the State's init() {} method as init({data}). In Phaser 3 a Scene has a second, data param, but it is not clear how it is used, the init method is not getting it, and the documentation is not ready for that as far as i know.
  2. Hello, I'm new in this forum. I have a problem with the init function. This is my code: BgLava = game.TilingSprite.extend({ init:function(){ this._super('lava.png', game.system.width, game.system.height, {speed:{x:0, y:25}}); game.scene.stage.addChild(this); game.scene.addObject(this); var t = game.scene.addTween(this.speed, {x: 100}, 1000, {easing: game.Tween.Easing.Back.In}).repeat().yoyo().start(); } });I extend the TilingSprite class and I try to tween the speed of the sprite. But nothing happens. If I move this line: var t = game.scene.addTween(this.speed, {x: 100}, 1000, {easing: game.Tween.Easing.Back.In}).repeat().yoyo().start(); to the game.scene code it works perfectly. I've had some problems with the init method before but this one I can't solve. It's like the this inside init() it's different from the object that's being created. CLASS = Class.extend({ init:function(){ console.log(this); //<-1 }});//* Inside Scenevar c = new CLASS();console.log(c); //<-2It's not pointing to the same object? Is there a way to create a tween for the speed inside the init function? Thanks!
×
×
  • Create New...