Ajout de la fonction render au monde
Joueur déplaçable début du cast de rayon Trop fatigué pour faire de la trigo
This commit is contained in:
parent
76306196c0
commit
59939d182b
5 changed files with 117 additions and 4 deletions
18
Player.cpp
18
Player.cpp
|
@ -8,3 +8,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;
|
||||
}
|
||||
|
||||
void Player::rotate(int alpha)
|
||||
{
|
||||
orientation += alpha%360;
|
||||
if(orientation >= 360)
|
||||
{
|
||||
orientation -= 360;
|
||||
}
|
||||
if(orientation <= 360)
|
||||
{
|
||||
orientation += 360;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue