From 207ee62eaabac19e5a24e45adf773f81ca48f896 Mon Sep 17 00:00:00 2001 From: cflip Date: Tue, 25 Jan 2022 17:16:28 -0700 Subject: 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. --- train.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 train.h (limited to 'train.h') diff --git a/train.h b/train.h new file mode 100644 index 0000000..249d92e --- /dev/null +++ b/train.h @@ -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 -- cgit v1.2.3