diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-07 11:29:57 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-07 11:29:57 -0500 |
commit | b53826079429939cdfbda073608cb85be8ba0738 (patch) | |
tree | 3c40de4658f0cea01cd3938f07fe82788ef3dd01 /src/mapview.h | |
parent | 0751446e1d069263d25abcff49a32a380231709a (diff) | |
download | therapy-b53826079429939cdfbda073608cb85be8ba0738.tar.gz therapy-b53826079429939cdfbda073608cb85be8ba0738.tar.bz2 therapy-b53826079429939cdfbda073608cb85be8ba0738.zip |
Created entity-component system
Also tweaked the bloom flicker, tweaked the scanline texture, created a second test map, and created some currently unused sound effects.
Diffstat (limited to 'src/mapview.h')
-rw-r--r-- | src/mapview.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/mapview.h b/src/mapview.h deleted file mode 100644 index 505ab25..0000000 --- a/src/mapview.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | #ifndef MAPVIEW_H | ||
2 | #define MAPVIEW_H | ||
3 | |||
4 | #include <list> | ||
5 | #include "state.h" | ||
6 | #include "mob.h" | ||
7 | #include "map.h" | ||
8 | |||
9 | using namespace::std; | ||
10 | |||
11 | const int TILE_WIDTH = 8; | ||
12 | const int TILE_HEIGHT = 8; | ||
13 | const int GAME_WIDTH = 320; | ||
14 | const int GAME_HEIGHT = 200; | ||
15 | const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH; | ||
16 | const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT; | ||
17 | |||
18 | const int FRAMES_PER_SECOND = 60; | ||
19 | const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; | ||
20 | |||
21 | enum direction_t { | ||
22 | up, left, down, right | ||
23 | }; | ||
24 | |||
25 | typedef struct { | ||
26 | int axis; | ||
27 | int lower; | ||
28 | int upper; | ||
29 | int type; | ||
30 | } collision_t; | ||
31 | |||
32 | class MapView : public State { | ||
33 | public: | ||
34 | MapView(Map* start, int x, int y); | ||
35 | ~MapView(); | ||
36 | void loadMap(Map* m); | ||
37 | void input(int key, int action); | ||
38 | void tick(); | ||
39 | void render(Texture* tex); | ||
40 | |||
41 | private: | ||
42 | void add_collision(int axis, int lower, int upper, direction_t dir, int type); | ||
43 | void check_collisions(mob_t* mob, int x_next, int y_next); | ||
44 | |||
45 | list<collision_t> left_collisions; | ||
46 | list<collision_t> right_collisions; | ||
47 | list<collision_t> up_collisions; | ||
48 | list<collision_t> down_collisions; | ||
49 | |||
50 | Texture* bg = NULL; | ||
51 | Texture* chara; | ||
52 | Texture* tiles; | ||
53 | |||
54 | bool holding_left = false; | ||
55 | bool holding_right = false; | ||
56 | bool holding_down = false; | ||
57 | bool holding_up = false; | ||
58 | mob_t* player; | ||
59 | |||
60 | Map* curMap; | ||
61 | |||
62 | int animFrame = 0; | ||
63 | }; | ||
64 | |||
65 | #endif | ||