actually add vendor folder
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
#include "Player.hpp"
|
||||
#include "raylib-cpp.hpp"
|
||||
|
||||
Player::Player() {
|
||||
position = Rectangle{
|
||||
GetScreenWidth() / 2.0f - 50,
|
||||
GetScreenHeight() / 2.0f - 50,
|
||||
100,
|
||||
100
|
||||
};
|
||||
speed = 3;
|
||||
}
|
||||
|
||||
void Player::Draw() {
|
||||
position.Draw(RED);
|
||||
}
|
||||
|
||||
void Player::Update() {
|
||||
if (IsKeyDown(KEY_UP)) {
|
||||
position.y -= speed;
|
||||
}
|
||||
if (IsKeyDown(KEY_DOWN)) {
|
||||
position.y += speed;
|
||||
}
|
||||
if (IsKeyDown(KEY_RIGHT)) {
|
||||
position.x += speed;
|
||||
}
|
||||
if (IsKeyDown(KEY_LEFT)) {
|
||||
position.x -= speed;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user