I have been following this tutorial: http://gameprogrammingpatterns.com/spatial-partition.html that essentially creates a grid of cells. Each cell contains a doubly-linked list of
Unit objects, and each cell is processed for collision checking.
In my code, I have an
Entity class that is the base class of many different classes, like
Bullet, etc. In this case, however, if I use a doubly-linked list of type
Entity, I am not exactly sure how I'd be able to tell that an
Entity is a
Player, for example, so I wouldn't be able to handle the specific collisions I want to.
Is there a way to handle these collisions that I'm missing?