From e16fb5be90c889c371cbb0ca2444735c2e12073c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 18 Feb 2018 12:35:45 -0500 Subject: 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. --- src/systems/playing.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/systems/playing.h (limited to 'src/systems/playing.h') 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 @@ +#ifndef PLAYING_H_70A54F7D +#define PLAYING_H_70A54F7D + +#include "system.h" + +class PlayingSystem : public System { +public: + + PlayingSystem(Game& game) : System(game) + { + } + + void tick(double dt); + + void initPlayer(); + + void changeMap(size_t mapId, double x, double y); + +}; + +#endif /* end of include guard: PLAYING_H_70A54F7D */ -- cgit 1.4.1