From 52de6c2e6c048b84a7665b6fc583b2259bbdd3af Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 26 Oct 2016 07:43:32 -0400 Subject: player stuff --- include/components.hpp | 6 ++++++ include/entities.hpp | 6 ------ include/player.hpp | 7 +++---- include/world.hpp | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 include/entities.hpp (limited to 'include') diff --git a/include/components.hpp b/include/components.hpp index 857236f..becc839 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -75,6 +75,12 @@ struct Health { int maxHealth; }; +struct Portal { + Portal(std::string tf = "") : toFile(tf) {} + + std::string toFile; +}; + /** * @struct Solid * @brief Allows an entity to collide with other objects. diff --git a/include/entities.hpp b/include/entities.hpp deleted file mode 100644 index f7c3894..0000000 --- a/include/entities.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef ENTITIES_HPP_ -#define ENTITIES_HPP_ - -void entityxTest(); - -#endif // ENTITIES_HPP_ diff --git a/include/player.hpp b/include/player.hpp index 6bad917..e196fa4 100644 --- a/include/player.hpp +++ b/include/player.hpp @@ -10,7 +10,7 @@ constexpr const float PLAYER_SPEED_CONSTANT = 0.15f; class PlayerSystem : public entityx::System, public entityx::Receiver { private: - entityx::Entity::Id pid; + entityx::Entity player; bool moveLeft; bool moveRight; @@ -21,6 +21,8 @@ public: PlayerSystem(void) : moveLeft(false), moveRight(false), speed(1.0f) {} + void create(void); + void configure(entityx::EventManager&); void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override; @@ -28,9 +30,6 @@ public: void receive(const KeyUpEvent&); void receive(const KeyDownEvent&); - inline void setPlayer(const entityx::Entity& e) - { pid = e.id(); } - vec2 getPosition(void) const; }; diff --git a/include/world.hpp b/include/world.hpp index 58dfc2c..fb0a5fa 100644 --- a/include/world.hpp +++ b/include/world.hpp @@ -167,6 +167,7 @@ public: void goWorldLeft(Position& p); void goWorldRight(Position& p); + void goWorldPortal(Position& p); // worlddata2 stuff WorldData2 worldData; -- cgit v1.2.3