Colliding with a city


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.

Files

tankies-html5.zip Play in browser
Version 17 Jan 10, 2024

Leave a comment

Log in with itch.io to leave a comment.