enemy comes to you when in his radius

This commit is contained in:
Remco
2016-05-23 08:48:23 +02:00
parent a8415db4ac
commit d01efecb0e
22 changed files with 7274 additions and 21 deletions
+3 -2
View File
@@ -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;
}
}