• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by samme

  1. time.elapsed is the interval between updates (ticks), so if the game loop is suspended and then resumed, a large elapsed value is correct. I think the difference you're seeing is that if you minimize the browser window, the game loop isn't actually suspended, it's just running in a paused state.
  2. For performance comparisons, you can use the browser's FPS meter or the browser's profile tool. It's a little tricky to compare profiles; you have to record identical durations and then compare raw time spent. 3. roundPixels is supposed to help more on less-powerful devices in CANVAS mode. Also interacts with Camera#roundPx. 4. The fps setting is global, as there's only one game loop. If you reduce desiredFps you should probably disable Game#forceSingleRender as well so you're not wasting renders. 6. You should prefer Phaser.Image where you can but the difference is probably very small. Image and Sprite are more similar now than in earlier versions. If you want to squeeze out extra performance here you might modify or remove the preUpdate/postUpdate methods (very carefully). 7. I think Phaser would have to be rewritten to really benefit from Offscreen Canvas. 9. I would guess cropRect, because it's simpler.
  3. This is correct. You could either move the overlap calls into the update method, after resetting the alpha (this is just like the Phaser 2 example), or you could bind to the scene's preupdate event and reset the alpha there.
  4. Try adding <meta name="viewport" content="width=1024, initial-scale=1">
  5. It worked for me in\zones\drop zone.js.
  6. sprite.setData('anims', { down: 'alien:down' left: 'alien:left', right: 'alien:right', up: 'alien:up', });
  7. Use game.debug.spriteInfo(…) and check the world coordinates.
  8. function update () { if (this.body.embedded) { this.body.touching.none = false; } if (body.touching.none && !this.body.wasTouching.none) { // Collision just ended } }
  9. You have to remember that animations using different textures or different cells-in-texture aren't really "the same", even if the frame sequence is similar.
  10. photonstorm/phaser/pull/4077 Also, there's no renderer property. It's type you want.
  11. Each game object receives a drop event as well, you can use that instead.
  12.\input\game object\on down event.js
  13. As long as the parrots are on the scene's update list or display list already, they will still get destroyed when you stop the scene. There's nothing extra you have to do.
  14. @rado9408 objects/dom element/
  15. You'll have to avoid the Phaser 2 tutorials because the code won't work in Phaser 3. See atlas json/&amp;q=
  16. samme

    Scale manager

    A comprehensive guide on creating custom builds of Phaser 3
  17. body.touching.up should show that also.
  18. Buttons have useHandCursor=true by default, that's why it shows on button on click.html.
  19. You can try converting it at
  20. align positions the lines relative to each other. If there's only one line of text, there's nothing to align.
  21. You probably shouldn't set useHandCursor=false from within a button handler because then Phaser won't know to remove the hand cursor later. See button on click.html. The hand cursor disappears when the button is disabled. If you have to reset the cursor manually, it's = '';
  22. Phaser.Physics.Arcade.Body#angularVelocity