1 decade ago by ansimuz
Its there a way to detect if an entity is surrounded by collision tiles, in other is stuck and i want to kill it if so.
Thanks :)
Thanks :)
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
// in your entity's update():
// find this entity's center point
var tx = this.pos.x + this.size.x/2,
ty = this.pos.y + this.size.y/2;
if( ig.game.collisionMap.getTile(tx, ty) ) {
// current tile is solid
}