From 8996810b1356c2224d4f34423fd4211de20da238 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 19 Feb 2019 16:22:39 -0500 Subject: Restrictions for moving into a space a block is moving out of An entity can only move into a space a block is moving out of if the time it would take the entity to move into the tile is at least the time remaining for the other block to finish moving out of the space. Also, crates can push each other now. --- src/entity.h | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/entity.h') diff --git a/src/entity.h b/src/entity.h index 0ff31e1..b606b43 100644 --- a/src/entity.h +++ b/src/entity.h @@ -1,21 +1,9 @@ #ifndef ENTITY_H_0D6CB29A #define ENTITY_H_0D6CB29A +#include #include "vector.h" - -enum class ColliderType { - player, - train, - other -}; - -enum class Direction { - none, - left, - right, - up, - down -}; +#include "enums.h" class Entity { public: @@ -39,9 +27,7 @@ public: // Collision ColliderType colliderType = ColliderType::other; - - bool playerCanPush = false; - bool trainCanPush = false; + std::set canBePushedBy; // Temp int colorVal = 25; -- cgit 1.4.1