Evil Cat Post-mortem

Posted by (twitter: @kerrichal)
January 1st, 2013 6:26 am

This is the third consecutive Ludum Dare where I have participated and Evil Cat is easily my best entry so far. When I started coding I was not very confident that I could end up having something good but after the first day everything started to fit well together and turned out into a nice game. Check it out!


What went right


It took a while (a whole morning) to decide the game I would do for this Ludum Dare. You are the Villain theme can be easily adapted to many videogame ideas just chaning good guys for bad guys, but I wanted something that suited the theme more naturally. I had two ideas in mind, one was doing some kind of Dungeon Keeper and the other was a game with a evil cat that wants to break alls the things in your house, well, like most of the cats use to do :). Usually I don’t like to use a physics systems without a good reason, I’m used to create simple verlet/euler integrators to have a decent physic/collision system and most games doesn’t require more than that. This way I have absolute control over the playability and fun factors of the game, one thing that I cannot assure when using a 3rd party engine. But from the beginning it was clear that I was going to require complex physics and collisions to make the game feel as realistic as it should.


I started creating the game boundaries and adding some static platforms with some boxes on top. For the cat I chose a round box2D collider, but the behaviour of the cat didn’t felt right when playing, the momentum and the low friction were affecting the playability too much and later on I decided to change the collision shape of the cat to another box. This circle collision code was later on used to develop the ball you see on the game. A lot of extra time was put on setting up the right values for the objects and the cat until the result was decent.


Wreck-It Cat

My two cats are adorable and they are too good to be cats, really. But all cats have a sixth sense to annoy you on the most inappropriate moments and I decided to base the main character on them (they look the same, no problem to choose one). The idea of showing what the cat was thinking came up very early, it was not difficult to imagine what the cat things when they break something, feel guilty is not in their dictionary. At the end it was one of the best ideas and people seem to enjoy them quite a lot.


One of the key features of the game is to break furniture and I hadn’t a clear idea on how to accomplish that. The tasks were two, first detect when an object must break and the other one split the object in different pieces.

The solution to detect when to break an object is not very academic but works. First I detect the collisions of the object and in case there is one the velocities of the object (both linear and angular) are used to calculate a value of damage to apply to the object. All physic objects inherit from a class named Element that takes care of these calculations in the cases the object is breakable. Each object has a robustness value that is decremented with each collision.

breaking bad

When an object is destroyed it is marked for destruction. Then, a routine generates particles based on the size of the object and transmits the physics values of the source object to the particles, adding a random factor. The particles are physic objects with a time to live and they use parts of the source bitmap as images. The graphic function that takes parts of the bitmap never worked very well, but I found myself spending too much time to code it and I chose to continue with the playability instead.

I had the breaking part done, which is quite entertaining by itself but how to turn this feature into a game didn’t come up until the second day. It was someway inspired in Katamari, you destroy small objects, you get stronger, you can destroy bigger objects, repeat until everything is destroyed. To make the cat gain weight was not an option so I went for the Cat Power skill, the more Cat Power the easier is to break things. The objective of the game changed from getting the most evilness possible to break everything in the house, a clearer objective very easy to understand.



I’m a programmer, doing graphics is probably one of my worst skills and I got surprised when I saw some comments of people praising the graphics quality. My target was only to have simple and understandable graphics. I didn’t want to spend many time doing art but I had no other option. Each new furniture needed a new graphic and I spent a lot of time doing art compared to my previous Ludum’s. Pixel art and a childish style allowed me to work fast, anyway anything more realistic is out of reach for my skills.


Level editing

How to edit the  level? how to put the furniture in the level? The first idea was going for the known solution, a tileset. But my objects had sizes and shapes so different that given the little time I had it felt like a bad idea, I would spend a lot of time setting up a tile editor for the game and then match what I have on the editor to what I see on the game. Then I aimed to do it via code, for one level it should be feasible. I have a function to put each furtinute of the game and I also have some macro functions to add the bookcases. This way I can add books easily with random size and color. I started populating the house from the bottom to the top, level by level with a trial and error approach. This way I could also hide the potential problems with the physic engine startup.


What went wrong


It had been a while since I used Box2D (2009), and I had forgotten everything so I started googling for some Box2D AS3 tutorials. As usual, the tutorials I found were from older versions of Box2D and the API had changed since them. I had to look the examples included on the Box2D package to learn something useful.

I had some objects with physics pretty fast, but then I had to program the cat, it is a different object because it’s controled by the played and you have to be very careful with with forces/impulses you apply to it because it’s very easy to lose the control of what’s happening with your main character. As expected using a physics engine was limiting the playability of the game. Changing the collider shape of the cat from a circle to a square definitely improved things, and I had to force some of the physics values of the cat object to deal with momentum. Probably not the best way to do it but what I could after a couple of hours of Box2D training.

Using Box2D in a two day project was a risk but I must say the engine is very good and it was worth using it.


The cursed lamplamp

Some people have had problems destroying the lamp on the top floor, I didn’t notice this while testing the game but definitely happens. The lower height of the top floor stops the lamps from rotating and it’s difficult to destroy it although possible to do with some patience or using the bed against the lamp.



Several people have complained the lack of sound in the game. To be sincere I could have done something but nothing of quality. It was almost 2 AM, very close to the deadline  and I was too tired to find a microphone and start recording samples with my cats . And about the music, well, the only programs I know to make songs are Amiga MOD trackers. I have a library to play them on Flash, but I’m  a poor musician, sure the game is much better without my music in there.



I had a great time developing this game and overcoming the different technical difficulties. It was awesp,e to do a game with cats too!  The challenge I have for the next Ludum Dare is to release something with sound, I have to check the competition rules properly, I think using standard MOD samples should be allowed if you compose the melody. Thanks to the Ludum Dare team and everybody participating in this wonderful contest. Happy New Year!

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]