• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by samme

  1. Hi feudalwars, body.angularVelocity, body.maxAngular, and body.rotation are actually in degrees, not radians (the docs are wrong there). sprite.rotation is in radians. I'd thought there was a Phaser function giving the smallest difference of two angles but I can't find it now. When angles wrap the absolute difference may not be the smallest one: e.g., from 359° to 1° should be +2° (clockwise), not -358° (anticlockwise).
  2. You should try Chrome's CPU profiler. Here's a desktop profile:
  3. The invisible sprite method is good. I've also used var distanceBetween = Phaser.Physics.Arcade.prototype.distanceBetween; Phaser.Physics.Arcade.Body.prototype.distanceTo = function(target) { return distanceBetween(,; }; Phaser.Physics.Arcade.Body.prototype.isBeyond = function(range, target) { return this.distanceTo(target) > range; }; Phaser.Physics.Arcade.Body.prototype.isWithin = function(range, target) { return this.distanceTo(target) <= range; };
  4. Hi symof, I mean that the shadow should be clipped to the asteroid (panels 6–7) instead of overflowing it (panels 3–4). It's like but I need to rotate the mask continuously without rotating the shadow texture beneath it.
  5. (1) an asteroid texture (2) a shadow texture (3) shadow covers asteroid (4) asteroid rotates but shadow doesn't shadow clips to asteroid's outline (5, 6) at its current rotation (7) end result I'm stuck at #5–6. Ideas?
  6. Glue is neat. glue ./images ./atlas --json # -> atlas/images.png # -> atlas/images.json # Descend into folders: glue ./images ./atlas --json --recursive # Make 1 atlas per folder: glue ./images ./atlas --json --project
  7. Done!
  8. Sure, post the modified source.
  9. I believe there's game.physics.arcade.checkCollision.bottom = false; = false;
  10. Now with filter and map: game.debug.graph(obj, { // options: collapse: true, filter: null, // function (obj) -> true || false map: null, // function (obj) -> "description" skipDead: false, skipNonexisting: false });
  11. Now with blocked, touching, and bodyDisabled.
  12. Here's a snippet to quickly look at a running game (run in console): ( || Phaser.GAMES[0]).load.script("SceneGraph", "", function (){; }).start();
  13. Draws properties of Arcade Physics bodies. Demo / Code npm i phaser-plugin-debug-arcade-physics
  14. Prints Phaser’s display tree. Demo / GitHub / NPM npm i phaser-plugin-scene-graph