|
|
|
@ -136,7 +136,7 @@ bool Monster::_SetX(float x,const bool monsterInvoked){ |
|
|
|
|
vf2d pushDir=geom2d::line<float>(collision.middle(),pos).vector().norm(); |
|
|
|
|
newPos={newPos.x,pos.y+pushDir.y*12}; |
|
|
|
|
if(NoEnemyCollisionWithTile()){ |
|
|
|
|
return _SetY(pos.y+pushDir.y,false); |
|
|
|
|
return _SetY(pos.y+pushDir.y*game->GetElapsedTime()*12,false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -166,7 +166,7 @@ bool Monster::_SetY(float y,const bool monsterInvoked){ |
|
|
|
|
vf2d pushDir=geom2d::line<float>(collision.middle(),pos).vector().norm(); |
|
|
|
|
newPos={pos.x+pushDir.x*12,newPos.y}; |
|
|
|
|
if(NoEnemyCollisionWithTile()){ |
|
|
|
|
return _SetX(pos.x+pushDir.x,false); |
|
|
|
|
return _SetX(pos.x+pushDir.x*game->GetElapsedTime()*12,false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|