samme

Members
  • Content Count

    2160
  • Joined

  • Last visited

  • Days Won

    24

Everything posted by samme

  1. a) You would have to add a CSS background yourself, behind the game canvas. b) this.cameras.main.centerX etc. c) Need to see code.
  2. https://samme.github.io/phaser-examples-mirror/bitmapdata/get pixel.html
  3. Phaser.Point.rotate(catHead, torso.x, torso.y, torso.angle, true, catHeadDist); Use anchor (0.5, 0.5) for both sprites. catHeadDist should be constant, I think.
  4. https://github.com/samme/phaser-parcel This is a simple 4-scene game (boot, menu, play, end) based on the Making your first game tutorial, so it may be a good next step from that.
  5. Use a Container, or update the weapon's position manually.
  6. I don't think Groups are intended to be nested (maybe you want Containers?).
  7. https://codepen.io/samme/pen/KGGRXY?editors=0010
  8. http://labs.phaser.io/edit.html?src=src\physics\arcade\velocity from angle.js
  9. Or use delayedPlay to schedule them in a sequence.
  10. Can you just make one long animation from all the frames?
  11. That's fine. You can also do some_objects.length = 0; You can also use a Group, which has built-in methods for a lot of these things.
  12. var ZOOM = 2; new Phaser.Game({ callbacks: { postBoot: function (game) { var config = game.config; var style = game.canvas.style; style.width = (ZOOM * config.width) + 'px'; style.height = (ZOOM * config.height) + 'px'; } } });
  13. Loading a tilemap file and creating/instantiating a Tilemap object are different. You can load as many tilemap files as you need, as long as you use distinct keys. It doesn't matter which scene you load them in, they're all stored in a single game cache. You can create a Tilemap object from any tilemap file already in the cache. The map belongs to the scene and lasts only as long as the scene does.
  14. That is the intended behavior in Phaser 2 (but the blank index is -1), so it may be the same.
  15. Not sure. You'd have to examine the canvas's CSS styles.
  16. Possibly the canvas is just too big (in pixels).
  17. You should use different cache keys for the two tilemaps.
  18. 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.