Collisions in place!

Today I should have implemented baddies. Problem is I have been terribly busy... Watching TV and playing Super Tux Kart! As such I have really only managed to get around to creating some form of base for solid objects that the player can't walk through.

At first the collision detection turned out to be quite flawed. Initially, solid objects were recognized as crooks, which resulted in death for the player if he touched a pillar, bush or brick. After that had been "fixed" (actually I just disabled dying from colliding with crooks) I found that magically, Wibbles could walk under objects like walls.

I didn't quite understand why at the time, but after a bit of experimenting I understood the problem. The sprite group which contained solid objects and the one which contained baddies were passed in the wrong order to a function, so crooks became bricks and bricks became crooks.

Once that had been fixed, it turned out that Wibbles would magically be teleported from the right side to the left side of a square if he collided with it from the top. Luckily hitting the square horizontally worked. Yet amazingly after a bit of hacking, collision didn't work at all, Wibbles was beeing teleported all over the place by the collision detection. Eventually I decided to try with the code I wrote yesterday (which had only teleported Wibbles around if he hit the box vertically) and IT WORKED FLAWLESSLY! Despite the fact that it had not been working just "minutes" ago.

So basically, today I have implemented a class that loads a picture, changes it's position to a given  set of coordinates, and then does absolutely nothing, in a matter of just hours! What that means for tomorrow is that I will have to make baddies, triggers and messages from the gods work in the first half of the day, so that I can make menus the other half and then start making levels. Looks like it might become a rather short game (right now it includes a cutscene and a level with a square on it, neither of which will be included in the final game).