Jump to content

Child sprite collisions


sdfgdsfgdfg
 Share

Recommended Posts

Hi

I'm trying to make my enemies turn in the opposite direction when they get close to the edge of a platform.

I've attached two 16 x 16 child sprites to enemies, one to the bottom left, the other to the bottom right. However, I can't get them to detect my map's collision layer (playState.collisionLayer - I'm using Tiled for maps and exporting to JSON). 

Ideally what would happen is if the enemy is moving left and the left child sprite stops colliding with the collision layer, the enemy would start moving right

Any tips?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...