From de5a458cb037bb8e1e80c849c5e6525f9413b43a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 14 Feb 2015 12:09:41 -0500 Subject: Monitor stuff is looking pretty cool! --- src/map.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/map.h (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h new file mode 100644 index 0000000..7986e0d --- /dev/null +++ b/src/map.h @@ -0,0 +1,42 @@ +#include +#include +#include "mob.h" +#include "renderer.h" + +using namespace::std; + +const int TILE_WIDTH = 8; +const int TILE_HEIGHT = 8; +const int GAME_WIDTH = 320; +const int GAME_HEIGHT = 200; +const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH; +const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT; + +enum direction_t { + up, left, down, right +}; + +typedef struct { + int axis; + int lower; + int upper; + int type; +} collision_t; + +class Map { +public: + Map(); + ~Map(); + void render(Texture* buffer); + void check_collisions(mob_t* mob, int x_next, int y_next); + +private: + void add_collision(int axis, int lower, int upper, direction_t dir, int type); + + list left_collisions; + list right_collisions; + list up_collisions; + list down_collisions; + + Texture* bg; +}; \ No newline at end of file -- cgit 1.4.1