1
0
Fork 0

Clean-up: Change indentation to tabs

This commit is contained in:
trotFunky 2024-01-28 22:08:35 +00:00
parent 9c9ec45304
commit bb20d4a520
6 changed files with 301 additions and 301 deletions

View file

@ -10,21 +10,21 @@ Player::Player(float x, float y, float alpha) : x(x), y(y), orientation(alpha)
void Player::move(float dx, float dy)
{
x += dx;
y += dy;
x += dx;
y += dy;
}
void Player::rotate(float alpha)
{
orientation += fmodf(alpha, 360);
if(orientation > 360)
{
orientation -= 360;
}
else if(orientation < 0)
{
orientation += 360;
}
orientation += fmodf(alpha, 360);
if(orientation > 360)
{
orientation -= 360;
}
else if(orientation < 0)
{
orientation += 360;
}
/*
* Rotate the movement vector along the new angle, assumes that the only
@ -33,9 +33,9 @@ void Player::rotate(float alpha)
float prevSpeedX = currentMoveSpeedX;
float prevSpeedY = currentMoveSpeedY;
currentMoveSpeedX = cosf(-alpha * deg_to_rad) * prevSpeedX
- sinf(-alpha * deg_to_rad) * prevSpeedY;
- sinf(-alpha * deg_to_rad) * prevSpeedY;
currentMoveSpeedY = sinf(-alpha * deg_to_rad) * prevSpeedX
+ cosf(-alpha * deg_to_rad) * prevSpeedY;
+ cosf(-alpha * deg_to_rad) * prevSpeedY;
}
void Player::updateSpeed(float localX, float localY) {