diff options
author | cflip <cflip@cflip.net> | 2022-03-24 08:45:00 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-03-24 08:45:33 -0600 |
commit | 0d99c20d0fafcf2b86d9d33430659de76b030395 (patch) | |
tree | 9a84c26683dcc7ddb09433d4bac5a0ff872c9189 /src/train.h | |
parent | 31d273c11bfd83a490ca538ba67d0a75f1d22cd7 (diff) |
Add acceleration/deceleration to the train
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/train.h b/src/train.h index 3cd23e4..178583f 100644 --- a/src/train.h +++ b/src/train.h @@ -14,6 +14,7 @@ public: void draw(Bitmap&, int, int); void setPosition(int x, int y); + void setSpeed(float speed) { m_speed = speed; }; // Add a vehicle to the end of this train void addVehicle(Train*); @@ -28,7 +29,8 @@ private: Level& m_level; int x { 0 }, y { 0 }; - float m_speed { 0.05f }; + float m_speed { 0.f }; + float m_acceleration { 0.98f }; float m_progress { 0.f }; Direction m_dir { North }; |