summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/train.h b/src/train.h
index 6f5cd23..dc09889 100644
--- a/src/train.h
+++ b/src/train.h
@@ -7,8 +7,8 @@ class Level;
class Train {
public:
- Train()
- : m_sprite("../res/car.png") { }
+ explicit Train(Level& level)
+ : m_sprite("../res/car.png"), m_level(level) { }
void update(Level&);
void draw(Bitmap&, int, int);
@@ -16,9 +16,11 @@ public:
void setPosition(int x, int y);
private:
- void nextTile();
+ void findDirection();
+ void findNextTile();
Bitmap m_sprite;
+ Level& m_level;
int x { 0 }, y { 0 };
float m_speed { 0.05f };