Tatwi/RocketTux

Badguys fall through solid tiles

Tatwi opened this issue · 1 comments

Tatwi commented

I noticed this happening since I changed some of solid tiles to only be solid on the top. I've never seen it happen, only encountered them in this state after they had been spawned while outside of the view port.

Possibly caused by:

  • A now top-side-only collision tile or two in the wrong spot.
  • Spawning badguys over solid tiles, which shouldn't happen, but such is life! :)
Tatwi commented

I found the problem, but I am not sure what to do about at the moment.

The Problem:
In places where a "top-side-only" collision tiles sits directly on a solid tile, the badguys cease to collide with the whole tilemap as soon as they overlap the "top-side-only" tile.
bad_spot

Notes:

  • Collision direction is set as a property of the tiles, with most being all sides and some being top side only.
  • In the update loop collision is checked per badguy sprite in this.game.physics.arcade.collide(this.enemies, this.theLevel, this.aiUpdate, null, this); where this.theLevel is the entire tilemap. It appears in this situation this check is skipped in all directions when one direction is skipped. I'm not sure how to fix that at the moment.