player = new Player(&player_status);
add_object(player);
+#ifdef USE_GRID
grid = new CollisionGrid(32000, 32000);
+#else
+ grid = 0;
+#endif
}
Sector::~Sector()
std::remove(bullets.begin(), bullets.end(), bullet),
bullets.end());
}
+#ifdef USE_GRID
MovingObject* movingobject = dynamic_cast<MovingObject*> (object);
if(movingobject) {
grid->remove_object(movingobject);
}
+#endif
delete *i;
i = gameobjects.erase(i);
}
if(bullet)
bullets.push_back(bullet);
+#ifdef USE_GRID
MovingObject* movingobject = dynamic_cast<MovingObject*> (object);
if(movingobject)
grid->add_object(movingobject);
+#endif
TileMap* tilemap = dynamic_cast<TileMap*> (object);
if(tilemap && tilemap->is_solid()) {
context.pop_transform();
}
-static const float DELTA = .001;
+static const float DELTA = .0001;
void
Sector::collision_tilemap(MovingObject* object, int depth)