Always Get the Basics

I was working on some code for the Zombie game just now. At the risk of giving away spoilers, I was writing code to make sure the player stayed in the bed of a truck, which will be driving about and therefore oriented in any different number of angles.

My game was using a strange coordinate system because I hadn’t bothered to write clean code. Most sprite based entities whose angle was ‘zero’ would face upwards, while mesh-based entities whose angle was zero would face to the right. On top of that, the way angles worked may have been counter-clockwise for the sprites and clockwise for the meshes. I knew i was going to have to fix this code eventually, but tonight I tried to unsuccessfully to write code for the player in the truck of the bed. My plan was to translate the player’s position to the truck’s coordinate system and then slide him into a certain box representing the bed of the truck but i kept getting screwed up results. I finaly gave up and rewrote the crappy code, and as a result everything is much smother now.

Moral of the story: get the basics down good.

Update: YEEEEEHAWWWW

Yee-Haww!

blog comments powered by Disqus