• Content count

  • Joined

  • Last visited

About B3L7

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. B3L7

    MatterJS Tilemap collision update?

    Good news! Tilemaps have had Matter collision since launch: https://labs.phaser.io/edit.html?src=src\game objects\tilemap\collision\matter.js
  2. B3L7

    Bullet trail question

    The particle emitter will probably work fine if your resolution is a decent size and the speed of the particles is low.
  3. B3L7

    Optimizing my game... tilemap vs giant images

    I spent a long time in Phaser 2 working with your aproach because the tilemap renderer was very much inferior in Phaser 2. I was batching the png level to the vram using texture priority and it worked very well performance wise but I was constantly running into limits with the upper limits of texture sizes for the GPU. That coupled with the massively increased development time for not using tilemaps (re-exporting pngs every time a change was made, handling all the groups, objects, etc), I came to the conclusion that this was a ton of work when I was essentially optimizing my game in early development which is a big mistake. Then I tested Phaser3's tilemap rendering and was blown away at how good the performance was. I came to the conclusion that it would be much better to use tilemaps in Phaser 3 and focus on developing the game and then swing back and worry about FPS close to the end. So far I found that Phaser3 can handle quite a complex scene with a good size tilemap and still performs great. Of couse a lot of this is dependent on your code and how big your tiles and map are. In terms of one way collisions I haven't gotten that far in Phaser3 but it was fairly easy to do in phaser 2 with arcade physics. It looks like the functionality is there for arcade in Phaser 3: https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Body.html#checkCollision So I would look at this Phaser 2 example and see if you can replicate it using Phaser3's API: https://phaser.io/examples/v2/arcade-physics/one-way-collision If you do get it working make sure you share your code. 😃
  4. B3L7

    Game scale plugin

    Yes! Thank you! This will really help until the scale manager comes out.
  5. B3L7

    Tiled objects

    Physics bodies really depend on what system you are using. In arcade you can change the size of the bodies for sprites and images fairly simply but as far as I know you can't change the size of the bodies on tiles (I could be wrong). So I believe that if you are using arcade physics then phaser will disregard collision shapes from tiled and just create a body the size of the tile. Matterjs allows for much more complex bodies and thus allows you to define collision shapes on tiles as well. Hope that makes sense.
  6. B3L7

    Tiled objects

    createFromOjects returns an array of the objects created. So in the first two examples your player is not the sprite itself but instead an array which contains the player sprite. createFromObjects is a fantastic method but its going to take a bit more to get it to do what you want. For instance you could check the contents of the array and assign them to variables. Or you could create custom gameobjects and register them to the GameObjectFactory which can then be created using createFromObjects. Your custom objects would have your additonal methods, movement etc. I cut all of that out and just made my own object creation method. See the convertObjects() method on my LevelScene: https://github.com/B3L7/phaser3-tilemap-pack/blob/master/src/scenes/Level.js
  7. B3L7

    Phaser 3 animation framerate

    You're welcome. In my experience I have found the camelCase to be pretty consistent.
  8. B3L7

    Phaser 3 animation framerate

    Try frameRate instead of framerate.
  9. Awesome! I've been using your repo as a reference for the typescript in my main project for awhile now. Cheers!
  10. You don't need to do anything with graphics, you need to define the collision shapes on the tileset in tiled: http://docs.mapeditor.org/en/stable/manual/editing-tilesets/ If you set the tile layer to collide by property and have a matter body on the player they will inherently collide. If you don't define a collision shape on the tile in the collision editor in tiled then Phaser will give the tile a square body the size of the tile. You don't need to tell matter what to collide with what unlike arcade. Everything collides unless the body is a sensor. Check this example to get a better idea: https://labs.phaser.io/edit.html?src=src\game objects\tilemap\collision\matter platformer with wall jumping.js
  11. B3L7

    Tilemap animated tiles

    Phaser 3 Animated Tiles Plugin
  12. In terms of examples: Nkholski's Bootstrap is excellent. I made a template that might not qualify as large scale but it has multiple modules.
  13. B3L7

    Angle to mouse pointer on Phaser 3

    What about something like: this.input.on('pointermove', function (pointer) { let cursor = pointer; let angle = Phaser.Math.Angle.Between(player.x, player.y, cursor.x + this.cameras.main.scrollX, cursor.y + this.cameras.main.scrollY) }, this); Not sure if you have scrolling in your game but if you do you need to take that into account for the cursor's position. Also if you are using arcade physics you can avoid figuring out the velocity by using moveTo() this.physics.moveTo(bullet, cursor.x, cursor.y); Of course you'l still have to figure out the rotation of the projectile. My tilemap project has, I think a more basic version of what you are trying to do if I understand you correctly: https://github.com/B3L7/phaser3-tilemap-pack The functionality I mentioned above is implemented between the player and fireball classes.
  14. B3L7

    Phaser 3 nine slice plugin!

    This looks great. Can't wait to try it out. Thank you!
  15. B3L7

    Change cursor on demand

    this.input.setDefaultCursor('url(assets/input/cursors/blue.cur), pointer'); https://labs.phaser.io/edit.html?src=src/input/cursors/custom cursor.js EDIT: Rich beat me to it.