Hello. I'm currently working on a simple 2D platformer and am implementing AI for an enemy much like the turtles in Mario. The walk left and right along a platform and when they reach the edge of the platform or hit a wall, they turn around and walk the other way.
I've implemented things like this in the past with sensors and the contact listener, however a teammate I'm working with has set it up with AABBs and callbacks. I was wondering if using a sensor or querying an AABB would be more efficient for doing this, as there will be several of these enemies per level.
If it helps, the map we're using is generated from an xml tile map, with each tile being a box shaped b2Body in the world.
Thanks!
I've implemented things like this in the past with sensors and the contact listener, however a teammate I'm working with has set it up with AABBs and callbacks. I was wondering if using a sensor or querying an AABB would be more efficient for doing this, as there will be several of these enemies per level.
If it helps, the map we're using is generated from an xml tile map, with each tile being a box shaped b2Body in the world.
Thanks!