Started on a larger test

This commit is contained in:
valtermiari 2023-03-10 09:32:22 +01:00
parent cdc802476d
commit 420b504016
2 changed files with 62 additions and 0 deletions

37
src/GC/tests/player.hpp Normal file
View file

@ -0,0 +1,37 @@
#include <string>
using std::string;
class Player {
private:
string name;
Point position;
Point size;
Point direction;
public:
Player(string n, Point pos, Point s, Point dir) {
name = n;
position = pos;
size = s;
direction = dir;
}
void move() {
position.x += direction.x;
position.y += direction.y;
}
void set_speed(int dx, int dy) {
direction.x = dx;
direction.y = dy;
}
};
struct Point {
int x, y;
};