Maharl

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. Maharl

    GameConfig

    Maybe these will be helpful: https://blog.jwiese.eu/en/2017/08/17/phaser-3-canvas-configuration/ https://rexrainbow.github.io/phaser3-rex-notes/docs/site/game/index.html https://labs.phaser.io/index.html?dir=game config/&q=
  2. Here is the tile spritesheet : Example: https://labs.phaser.io/edit.html?src=src\game objects\tilemap\collision\csv map arcade physics.js These white stripes appear when the camera moves in this example, I have this problem in my own game, any idea what one can do about it? The only thing I could think of doing about it was to add empty tiles to the tile sprite sheet so that transparent tiles would not get stripped by the tile beside it.
  3. Maharl

    Collide on all touched tiles with sprite

    Anyone know how to do this in Phaser 3?
  4. Her is an example based on a Phaser 2 example, 0 index is set as colliding: Her is the tiled json file: https://examples.phaser.io/assets/games/starstruck/level1.json Phaser 2 example where empty (index 0 in tiled json) is not collideable: https://phaser.io/examples/v2/games/starstruck What is the easiest way to fix this in phaser 3? Setting 0 in setCollisionByExclusion method does not exclude it from collision.
  5. Maharl

    Collide on all touched tiles with sprite

    Thank you so much, this was a great Christmas present 😄
  6. Maharl

    Collide on all touched tiles with sprite

    What is the best way to the result I want?
  7. Code pen: I am moving a NPC back and forth on a plattform by checking if the end tile is one of the tiles that are edges in the tilemap and if so swicthing the x velocity. I am having trouble with getting the moving sprite to move equally as far out of the edge of the plattform on both sides, but it seems the sprite is only colliding with one tile at the time, namely the tile that is touching the right bottom corder of the sprite, can I set the collide to be on the tile that is under the middle of the sprite?
  8. Maharl

    Size of platform in Layer

    Turns out that in the callback function of a collide sprite and layer you know the tile and the index of the tile the sprite hit, so instead of testing on the length one can test based on if the index of the tile is a tile type that is the end of platform tile. So you can tell based on the terrain rather than platform length when sprite should turn. this.game.physics.arcade.collide(this, layer, function (sprite, tile) { var i = tile.index; if (i == 1 || i == 6 || i == 7 || i == 8) { sprite.body.velocity.x *= -1; } });
  9. Maharl

    Size of platform in Layer

    Very sorry if someone has asked this before, but I searched the internet for two days now and I have yet to find the answer to this. So, what I want to know is how can I tell the size (width, height) of the platform that a player/enemy is standing on, with platforms that are based on a tilemap/layer? Take for example this game phase example starstruck: https://phaser.io/examples/v2/games/starstruck How can I tell the size of that platform the mascot falls on first? Why do I want to know this? I want to know so that I can place enemies on the map, have them go back and worth without falling off a platform. I have seen this be done when platforms are created as a group, but not with platforms in a layer. Thank you very much for any help.