Fight back the reapers and lead the young country of Lotte to victory! Kaepe is a story driven tower defense game featuring dynamic path finding, an expansive universe, rich story line, and plenty of achievements. The final version will also include a level editor and access to community built levels.
This week I spent a lot of time adding features and optimizing the game framework I created for Kaepe. The main new feature I have added is rotated hitboxes using the separating axis theorem.
Posted by iamscissors on Sep 20th, 2011
This week I spent a lot of time adding features and optimizing the game framework I created for Kaepe. The main new feature I have added is rotated hitboxes using the separating axis theorem. I have uploaded the code at jsdo.it if you would like to take a look. The only important function is the is_colliding(obj1, obj2) function. which returns either true (if a collision has occurred) or false if they are not touching. I have found that on my computer, with my browser, each collision takes less than a millisecond. I have conservatively estimated it takes about .01 of a millisecond on average. That means I could have roughly 3000 checks per second if my game was running at 30 ticks a second.
1s/30ticks = 33.33 ms a tick
33.3/.01=3330 collision checks a second
If you would like to test it I would love to hear the averages your computer pulls! I am still actively working to speed the entire engine up.