samme

Members
  • Content count

    446
  • Joined

  • Last visited

  • Days Won

    4

samme last won the day on December 16 2016

samme had the most liked content!

About samme

Contact Methods

  • Website URL
    https://github.com/samme

Profile Information

  • Gender
  1. Don't do that, Phaser makes the Stage for you. Move the rest into create: game = new Phaser.Game(1000, 600, Phaser.AUTO, 'gameCanvas', {preload: preload, create: create, update: update}, false, false); function init() { game.stage.disableVisibilityChange = true; // … } You can keep using game.add.sprite.
  2. Try: var fontScoreWhite = { font: "24px Avenir", fill: "#000000", boundsAlignH: "center", boundsAlignV: "middle" }; this.timeText = this.add.text(0, 0, this._time, fontScoreWhite); this.timeText.setTextBounds(X, Y, WIDTH, HEIGHT); // ← position the text here // REMOVE: anchor.set(…)
  3. You should use something like this.timeText.setTextBounds(0, 0, 50, 100); The "boundary" needs to be larger than the text itself, otherwise there's no room to align it. Try:
  4. https://phaser.io/examples/v2/loader/load-starling-atlas
  5. Bump with details.
  6. It's simpler, more performant, and more accurate. And it will pause when the game pauses.
  7. The bounds height should be larger than the text height (equal to the clock height, in this case).
  8. 180° is wrapped to -180°.
  9. Check that the player's `parent` is wheelB (and not null). Check that the player's `position` is what you want (maybe [0, 0]). It may be off screen.
  10. https://phaser.io/docs/2.6.2/Phaser.ScaleManager.html
  11. Phaser has both. For continuous input, it's more efficient and accurate to test the key directly. For infrequent events, you can bind to Phaser.Key.html#onDown. There's no need to add your own DOM handlers.
  12. Phaser.Button.html#onInputUpHandler Phaser.Events.html#onInputUp → Phaser.Signal.html#dispatch
  13. They're all the same kind. A state is a set of callbacks comprising an init–preload–create–update/render–shutdown cycle. In simple games (like all the Phaser examples), you're just filling in the methods of the default state.
  14. Try adding and sizing a child sprite, and listening for input on that.