itch.io is community of indie game creators and players

Devlogs

Colliding with a city

tankies
A browser game made in HTML5

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 14 MB
    Version 17
Leave a comment