• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by samme

  1. OK, it turns out Phaser.Physics.Arcade.StaticBody#drawDebug draws a rectangle no matter what the body shape. You could try Phaser.Physics.Arcade.StaticBody.prototype.drawDebug = Phaser.Physics.Arcade.Body.prototype.drawDebug;
  2. setDrag will work, with or without damping, as long as acceleration is 0. accelerate to (setDrag w/o damping) asteroids movement (setDrag w/ damping)
  4. samme

    Tutorial requests

    You can use a PathFollower (it seems to work nearly the same way) but friction doesn't work, so the rider falls off.
  5. I think it's fine to override the preUpdate method if you like. A lot of the examples do this. Nb. It won't work for Game Objects without a preUpdate method (e.g., Image). You have to remember to call the parent class's preUpdate method. preUpdate comes a little earlier than update. For instance, with ArcadeSprite, preUpdate runs right before the physics step whereas update runs right after. For a lot of cases I'd guess it doesn't make a big difference, though.
  6. var hero = this.add.existing( new spriteStats(this, 100, 450, 'hero', 0) );
  7. I think if you use { loop: -1 } instead you'll get the duration you want.
  8. samme

    destroy video

    var aide, aideImg; function create() { aide ='aide');; aideImg = aide.addToWorld(); closeAide = game.add.button(20, 20, 'closeAide',clicCloseAide); } function clicCloseAide() { aideImg.destroy(); aide.destroy(); closeAide.destroy(); }
  9. (Graphics) There's also CanvasTexture.
  11. You're right, that does seem to contradict the docs.
  12. Yes, you can check world.bounds directly in update() and that may work better. You can use ContainsRect as well. After disableBody a Game Object can be reset/reactivated later. After destroy it can't.
  13. I think you'll have a problem in hitBomb either way because the two this keywords are intended to reference different objects. So I would do this: this.physics.add.collider( this.player, this.bombs, function (player, bomb) { this.physics.pause(); npcs.hitBomb(player, bomb); }, null, this )
  15. When you draw to a RenderTexture, it's not affected by the scene camera or the game canvas, AFAIK. It's just a blank texture of a defined size.
  16. preload just starts the load queue, it hasn't finished by then.
  17. You would have to move the scene camera to see the rest. Or just scale down the RenderTexture to see the whole thing.
  18. Sprites with exists=false are ignored during collision checks, so that would be unexpected unless an item is being revived/reset soon after being killed.
  19. Phaser 3 has no Bullet class and no outOfBoundsKill property. You can use the worldbounds event.
  20. samme

    Tutorial requests

    See arcade body on a path