28 lines
417 B
C++
28 lines
417 B
C++
//
|
|
// Created by trotfunky on 27/05/19.
|
|
//
|
|
|
|
#include "Player.h"
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
void Player::rotate(int alpha)
|
|
{
|
|
orientation += alpha%360;
|
|
if(orientation >= 360)
|
|
{
|
|
orientation -= 360;
|
|
}
|
|
if(orientation <= 360)
|
|
{
|
|
orientation += 360;
|
|
}
|
|
}
|