0
\$\begingroup\$

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 Wall, Player, 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 Wall or 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?

\$\endgroup\$
  • 1
    \$\begingroup\$ I am confused as to why you have the collision-detection tag. Are you looking for ways to implement collision detection, or are you looking for ways to identify your Entitys? \$\endgroup\$ – Alex F May 26 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.