samme

Members
  • Content Count

    2160
  • Joined

  • Last visited

  • Days Won

    24

Everything posted by samme

  1. setDrag will work, with or without damping, as long as acceleration is 0. accelerate to (setDrag w/o damping) asteroids movement (setDrag w/ damping)
  2. https://codepen.io/samme/pen/wYLQOY
  3. 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.
  4. 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.
  5. var hero = this.add.existing( new spriteStats(this, 100, 450, 'hero', 0) );
  6. I think if you use { loop: -1 } instead you'll get the duration you want.
  7. samme

    destroy video

    var aide, aideImg; function create() { aide = game.add.video('aide'); aide.play(true); aideImg = aide.addToWorld(); closeAide = game.add.button(20, 20, 'closeAide',clicCloseAide); } function clicCloseAide() { aideImg.destroy(); aide.destroy(); closeAide.destroy(); }
  8. https://codepen.io/samme/pen/PBMaLJ (Graphics) There's also CanvasTexture.
  9. https://github.com/photonstorm/phaser-ce/blob/master/README.md#browserify--commonjs
  10. You're right, that does seem to contradict the docs.
  11. 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.
  12. 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 )
  13. https://codepen.io/samme/pen/MPNpEa?editors=0010
  14. 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.
  15. preload just starts the load queue, it hasn't finished by then.
  16. You would have to move the scene camera to see the rest. Or just scale down the RenderTexture to see the whole thing.
  17. 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.
  18. Phaser 3 has no Bullet class and no outOfBoundsKill property. You can use the worldbounds event.
  19. samme

    Tutorial requests

    See arcade body on a path
  20. Locking the screen orientation