diff options
author | cflip <cflip@cflip.net> | 2022-01-25 17:16:28 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-01-25 17:16:28 -0700 |
commit | 207ee62eaabac19e5a24e45adf773f81ca48f896 (patch) | |
tree | 90e71eacecd9a1294da21082a304483f27d35a18 /train.h | |
parent | e0f29aa0b03807ef3968edd5673d9dc5637f32af (diff) |
Implement simple train car
For now, the car just exists at a certain tile and has a 'progress'
timer until it moves to the next track tile.
Diffstat (limited to 'train.h')
-rw-r--r-- | train.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#pragma once + +#include "bitmap.h" + +enum CarDirection { + North, + East, + South, + West +}; + +class Level; + +class TrainCar { +public: + TrainCar(int x, int y) + : x(x), y(y), m_sprite("car.png") {} + + void update(Level&); + void draw(Bitmap&, int, int); + + int x, y; +private: + Bitmap m_sprite; + int m_progress; + CarDirection m_dir; +};
\ No newline at end of file |