diff --git a/src/common/haxe/ru/m/tankz/engine/Engine.hx b/src/common/haxe/ru/m/tankz/engine/Engine.hx index a7d4df2..6aca60d 100755 --- a/src/common/haxe/ru/m/tankz/engine/Engine.hx +++ b/src/common/haxe/ru/m/tankz/engine/Engine.hx @@ -231,6 +231,16 @@ class Engine extends EngineDispatcher implements ControlHandler { var with = EntityTypeResolver.of(cell); collisionSignal.emit(entityType, with); isStop = true; + // fix position + if (cells.length == 1) { + if (entity.mx != 0) { + var d = entity.rect.center.y - cell.rect.center.y; + entity.rect.y += d / Math.abs(d); + } else if (entity.my != 0) { + var d = entity.rect.center.x - cell.rect.center.x; + entity.rect.x += d / Math.abs(d); + } + } break; } }