Posted January 10, 2024 by greenflysau
I have added a city, along with the code to detect the tank colliding with the city. This is complicated too! I am using the "bus pattern" to detect a collision.
I want the code for the collision handler to be in the main/world code. Units shouldn't know about what they are colliding with, nor how to handle it. That said, the unit still knows to move, if the space is free.
I also noticed some code duplication when I added the city, so I made a new "common" singleton for that.