Jump to content

Search the Community

Showing results for tags 'Animations in prefab'.

  • 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 1 result

  1. Hi, I'm creating a 3d/2d world. I'm trying to create prefab so it's easy to structure and re-use the code. I found a weird issue with prefabs that is using animations. You expect that when you create a object of your class in your state, you mostly provide the parameter with "this" that stands for the game object: this.pl1 = new PL1(this, this.loadMap.playx, this.loadMap.playy); this.add.existing(this.pl1); In the prefab class i'm adding my animation: this.animations.add('left', [1,2], 10, true); but as soon when i run the game, it will raise an error: http://screencast.com/t/GICvrV1x This will happen only when i'm using animations. The solution at this moment that i found (as weird as it sounds) is to create the object class like this: this.pl1 = new PL1(this.game, this.loadMap.playx, this.loadMap.playy); I'm just adding this.game instead of this, this only works for prefab classes that having animations included. This class also has 'use strict'; at the top, like all the other prefab classes. Is there another way to solve this issue? Because at this moment i can't use global variables in my player class, because it's using another game object. Grtz, Peter
×
×
  • Create New...