Game test!
Co-authored-by: ValterMiari <ValterMiari@users.noreply.github.com>
This commit is contained in:
parent
24daa73a39
commit
02c9ae0ab4
10 changed files with 162 additions and 69 deletions
|
|
@ -2,6 +2,14 @@
|
|||
|
||||
using std::string;
|
||||
|
||||
class Point {
|
||||
|
||||
public:
|
||||
|
||||
int x, y;
|
||||
Point(int _x, int _y) : x(_x), y(_y) {}
|
||||
};
|
||||
|
||||
class Player {
|
||||
|
||||
private:
|
||||
|
|
@ -13,12 +21,9 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
Player(string n, Point pos, Point s, Point dir) {
|
||||
name = n;
|
||||
position = pos;
|
||||
size = s;
|
||||
direction = dir;
|
||||
}
|
||||
Player(string n, Point pos, Point s, Point dir)
|
||||
: name(n), position(pos.x, pos.y), size(s.x, s.y), direction(dir.x, dir.y)
|
||||
{}
|
||||
|
||||
void move() {
|
||||
position.x += direction.x;
|
||||
|
|
@ -31,7 +36,3 @@ public:
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
struct Point {
|
||||
int x, y;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue