• Content count

  • Joined

  • Last visited

About rblopes

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

561 profile views
  1. Functions outside update dont work

    What happens if you modify those lines and place handleCollisions() before handleJump() inside your update loop? update () { this.handleCollisions(); // <--- this.handleJump(); this.handleInput(); }
  2. Phaser Lite

    Just browse the "build/custom" folder in Phaser CE repository on GitHub. The "phaser-no-physics.js" might interest you. And if you downloaded Phaser CE from npm, you'll find these files inside the phaser-ce package too.
  3. Losing Scope when passing between functions.

    Oh, sorry. What I meant by 'too many params' is that, in that code snippet you posted, you have 8 parameters in your `Fish` constructor (`pSize` is the last one). Maybe you're omitting it or not passing those parameters in the expected order.
  4. Losing Scope when passing between functions.

    Your code seems to be fine for me... Maybe too many params?
  5. Losing Scope when passing between functions.

    Not sure if you've omitted this part of the code, but you're not assigning `pSize` to your prototype. this.pSize = pSize; // ... this.setSize(this.pSize);
  6. local storage with JSON error

    That way you're trying to save a whole game object to localStorage. Rather than storing the whole sprite object just to retrieve a few properties later, what you really want is to pick just the properties you're interested in restoring later. Example: // To store in `localStorage`: function reveal_param(sprite){ var projectile = { name: sprite.name, number: sprite.number, // ... etc ... }; localStorage.setItem('_projectile', JSON.stringify(projectile)); } // To recover that object later: var projectile = JSON.parse( localStorage.getItem( '_projectile' ) ) ; alert(projectile.name);
  7. gulp or grunt?

    The sole purpose of UglifyJS is to obfuscate and compress code. It works the same for both. For Gulp, use this plugin, and this one for Grunt. So, which task manager do you intend to use?
  8. Manually add spritesheet to cache

    Could it be this: http://phaser.io/examples/v2/animation/dynamic-animation // And now add it to the cache, so any sprite can use it // The parameters can be found in the API docs, but the important parts are to leave the URL blank and pass the bmd.canvas as the data value // The 22x22 is the frame size and 16 the quantity of frames game.cache.addSpriteSheet('dynamic', '', bmd.canvas, 22, 22, 16, 0, 0);
  9. Issues when creating a small FOSS Phaser.io UI library

    HI, @JTronLabs. I sent you a pull request last night with some modifications that may help you solve your problem. Your test project is using the "No Physics" custom build that omits, among Arcade and P2 physics engines, several other features, including: Tiled Tilemaps support; The Weapons Plugin; and The Particles system. I don't know how much these features are related or how they specifically depend on Arcade Physics. At least, for the Weapons plugin it does make sense to omit it, I'm not convinced about the others, though. But this is how Phaser 2 was designed, and I won't discuss it here further. (I bet someone could figure out a way and make Tilemaps or Particles no longer tied to AP.) So, even if you add Phaser as an external dependency to your library, that may not help you much. If your component depends on a class that's not included in a Phaser build (which is causing the "class extends undefined" issue), it'll just fail to load. So your best bet there is to include, at least, some kind of feature detection. Hope that helps.