• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by samme

  1. All of the Phaser Geom classes have contains tests.
  2. It does have examples.
  3. { scene: { preload: preload, create: create, update: update, extend: { collideaa: collideaa } } } this.collideaa();
  4. Could switch to dynamic tilemap layers, if you're using static.
  5. There's no viewPort method. Make sure you have the console open to catch errors!
  6. If you have physics bodies with collideWorldBounds=true they will be immediately moved inside the physics world bounds if they were created outside it. If you change the camera bounds such that the camera is outside them them it will immediately move to the nearest edge. If you have the camera follow a sprite it will move immediately (unless lerped) to center on the sprite. I would try to get everything in your game positioned as you want first before configuring the camera at all, because it can get confusing once the camera starts moving.
  7. I tried the same on objects\tilemap\static\create from objects.js and it worked, so I'm not sure. Turn on physics debugging and debug-draw the tilemap layer (see the examples). That will show you if the sprites have physics bodies and if the tile collision edges are correct. Technically I think you should be doing this.enemies =; this.enemies.addMultiple( map.createFromObjects('enemies_objects', 'enemy1', { key: 'enemies' }) ); instead of overwriting this.enemies, but I'm not sure that will make a difference.
  8. What is the page address in your browser? Remove this:
  9. if (gameoverID == false) { if (this.boy.y > this.cameras.main.height || this.boy.y <= 0) { this.physics.pause(); } }
  10. You might also try without forceSetTimeout.
  11. this.add.tween({ targets: enemies2.getChildren().map(function (c) { return c.body.velocity }), x: X, y: Y, // … }); or this.tweens.addCounter({ from: X1, to: X2, onUpdate: function (tween) { enemies2.setVelocityX(tween.getValue()); }, // … });
  12. Add this to the beginning of create and then look at the output: console.log(this.cache.tilemap.get('map').data); You can find the correct tileset names in there. If you have layer compression on, turn it off and reexport the map.
  13. Which properties do you want to tween?
  14. That should work. If you don't need extra params than you can just use this.enemies.create(200, 200, 'enemy_sprite'); Did it fix the hitboxes?
  15.\camera\set bounds.js
  16. How are you setting the texture of the enemy sprites? If there's no texture specified when the body is created it will get the size of default one (32 × 32). You need something like class Enemy extends Phaser.GameObjects.Sprite { constructor(scene, x, y, key, frame) { super(scene, x, y, key, frame); // … } }
  17. Are you doing anything else to size/scale the enemy sprites or their textures? Because ordinarily the hitboxes should be the "right" size without you having to do anything special.
  18. You may have to use a physics group for that. Also turn on physics debugging, just in case.
  19. Phaser 3 also has camera follow with interpolation. And you can start with a small coefficient and then increase it.
  20. kill only deactivates and hides an object. You need destroy if you want to remove it permanently. Try pendingDestroy if destroying an object from a callback causes problems.
  21. Adjust the body offset or position. Fall-through happens when you enlarge the body and extend the bottom edge through the floor below.
  22. There's no this.physics.arcade object. Only this.physics. Unlike Phaser 2, there's no angleToPointer method, but you can calculate it:\physics\arcade\velocity from angle.js