From d9c201cbf2fbfe315137e141d886a9bbfa6794ba Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 20 Feb 2019 16:44:09 -0500 Subject: Started implementing schedule Scheduled entities move downward every beat, although they have a speed that is twice the bpm, so essentially they move every other beat? Broke the simulation loop such that different parts run independently -- made it horizontal rather than vertical. Encapsulated the grid cache so that more than one position field could be cached. This is used to make sure that an entity can't move into a space that something else is already moving into. Fixed issue where an entity could move perpendicularly into the space an entity was moving out of. --- src/main.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c77d25b..c0ba15f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,33 +13,6 @@ int main(int, char**) Level level; Simulation sim(level); - Simulation::id_type player = sim.emplaceEntity(); - Entity& entity = sim.getEntity(player); - entity.size = TILE_SIZE; - entity.speed = 3.0; - entity.controllable = true; - entity.colliderType = ColliderType::player; - entity.colorVal = 180; - sim.setGridPos(player, vec2s { 1, 5 } ); - - Simulation::id_type crateId = sim.emplaceEntity(); - Entity& crate = sim.getEntity(crateId); - crate.size = TILE_SIZE; - crate.speed = 4.0; - crate.colliderType = ColliderType::crate; - crate.canBePushedBy.insert(ColliderType::player); - crate.canBePushedBy.insert(ColliderType::crate); - sim.setGridPos(crateId, vec2s { 4, 5 } ); - - Simulation::id_type crateId2 = sim.emplaceEntity(); - Entity& crate2 = sim.getEntity(crateId2); - crate2.size = TILE_SIZE; - crate2.speed = 4.0; - crate2.colliderType = ColliderType::crate; - crate2.canBePushedBy.insert(ColliderType::player); - crate2.canBePushedBy.insert(ColliderType::crate); - sim.setGridPos(crateId2, vec2s { 6, 7 } ); - bool quit = false; SDL_Event e; -- cgit 1.4.1