summary refs log tree commit diff stats
path: root/src/systems/playing.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 12:35:45 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 12:35:45 -0500
commite16fb5be90c889c371cbb0ca2444735c2e12073c (patch)
treecbaa20e14a34c460b6c9886f266c4b4b6f62ae87 /src/systems/playing.h
parented08b673c50b076042d8f0c49501372168142764 (diff)
downloadtherapy-e16fb5be90c889c371cbb0ca2444735c2e12073c.tar.gz
therapy-e16fb5be90c889c371cbb0ca2444735c2e12073c.tar.bz2
therapy-e16fb5be90c889c371cbb0ca2444735c2e12073c.zip
Implemented map adjacency
This brings along with it the ability to move to different maps, for which the PlayingSystem and PlayableComponent were introduced. The PlayingSystem is a general overseer system that handles big picture stuff like initializing the player and changing maps. The PlayableComponent represents the player. While the ControllableComponent is also likely to always only be on the player entity, the two are distinct by separation of concerns.

This also required a refactoring of how collisions are processed, because of a bug where the player can move to a new map when horizontal collisions are checked, and vertical collisions are skipped, causing the player to clip through the ground because the normal force was never handled.
Diffstat (limited to 'src/systems/playing.h')
-rw-r--r--src/systems/playing.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/systems/playing.h b/src/systems/playing.h new file mode 100644 index 0000000..c98a464 --- /dev/null +++ b/src/systems/playing.h
@@ -0,0 +1,21 @@
1#ifndef PLAYING_H_70A54F7D
2#define PLAYING_H_70A54F7D
3
4#include "system.h"
5
6class PlayingSystem : public System {
7public:
8
9 PlayingSystem(Game& game) : System(game)
10 {
11 }
12
13 void tick(double dt);
14
15 void initPlayer();
16
17 void changeMap(size_t mapId, double x, double y);
18
19};
20
21#endif /* end of include guard: PLAYING_H_70A54F7D */