enemy comes to you when in his radius
This commit is contained in:
+3
-2
@@ -18,11 +18,12 @@ void Player::setCamera()
|
||||
|
||||
void Player::setPosition(float angle, float fac, bool height)
|
||||
{
|
||||
fac *= speed;
|
||||
if (height)
|
||||
position.y += angle*fac;
|
||||
else
|
||||
{
|
||||
position.x -= (float)cos((rotation.y + angle) / 180 * M_PI) * fac*speed;
|
||||
position.z -= (float)sin((rotation.y + angle) / 180 * M_PI) * fac*speed;
|
||||
position.x -= (float)cos((rotation.y + angle) / 180 * M_PI) * fac;
|
||||
position.z -= (float)sin((rotation.y + angle) / 180 * M_PI) * fac;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user