Collision

So this week I’ve started working on the project for real, a bit late but I think we can manage.

I’ve been working on a HUD-class that so far displays a sprite on top of everything else. The HUD is going to display the score and the a timer.

Today me and Erik have merged our projects by sitting next to each other and copying from one project to the other, not very time efficient, but we had a hard time learning how those other programs work.

Either way, we now have proper Axis Aligned bounding box collision detection, that we took from the Arkanoid code our teacher wrote. I’ve put the collision checking to use, so if the player touches the explosion sprites his position will be reset to the middle of the map, and if an enemy touches an explosion sprite he will be deactivated and the player gets some score. Also we have collision checking with the tile map now.

In order for all of this to work, we had to put all of the things that will have collision in the same entity vector instead of four different vectors, since the collider class inherits from the entity class.

I also tried to enable the spawning of more than one bomb, but remembered why I made it so only one bomb could spawn in the first place.

About Johan Holmér

2014  Programming