Tuesday 3 January 2012

Cleaning up collision logic

Originally I Just used a couple of booleans to let me know if and where the player had collided.

Not very informative though, so I've added a collision enun that now tells me the state of collision

* none
* building
* roof

I can then use these accordingly to achieve other game mechanics later on.

1 comment:

  1. Why not store a reference to the thing you are colliding with? That would give you more flexibility.

    ReplyDelete