churf/src/GC/tests/player.hpp
2023-03-10 09:32:22 +01:00

37 lines
No EOL
523 B
C++

#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;
};