FleaGame

The FleaGame was started just to show a co-worker how quickly a simple platformer mechanic could be put together. It started as a sprite represented by a single black pixel standing atop a single floating block. Gravity pulled you down constantly, and collision detection kept you from falling through the block. If you fell off the edge of the block you died and the program exited. You could move left and right and jump.

Eventually I started keeping compiled versions around to show people the changes over time. This is where the YouTube channel comes into play. I have recorded the game for each of the various versions I’ve built so that everyone can see how it has changed over time. Eventually I’ll get it into source control of some sort so that I don’t have to keep track of executable files.

The game runs at 60 frames per second, but the videos are not recorded at the same rate so it looks better in person at this time (plus the compression of the video isn’t helping).

December 6, 2012

This first video is of the oldest compiled copy of the game. Only the Flea, Bullets and Blocks that make up the stage/platform exist. Well, technically the cursor is also a sprite, but it has very little logic. The Flea is a 3×3 pixel square and the bullets are a bit larger for effect. If a flea could shoot a gun, the bullets may as well be huge. Collision detection works, the flea can double jump (during the top half of the arch according to time), and there is an invisible hole in the bottom of the level. Next the game needed something to shoot at.

December 23, 2012

I was picturing a hovering cloud of blackness that you could throw your weaponry against and the bodies would rain out of the sky, like in a zombie apocalypse in the scene where the camera zooms out and there are an uncountable number of zombies. Given the player plays as a Flea, I determined Flies would be an appropriate enemy. Once the flies were done I threw 10 into the game and compiled it in release. They start at a spawn point and then just follow their random flight paths. Personally, I think their movement is pretty nice looking (the video only runs at approx half the frame rate of the game, so it is nicer looking in person). Once I had that set up, a change to a single integer in the code changed the number of flies that spawned, so I decided to crank it up and see what the limit was.

In Debug compilation the limit was between 250 and 300 Flies, but that wasn’t a satisfying performance. I switched to Release and hit 1000 Flies no problem:

So now I was pretty satisfied, but it was running really smoothly, and was still curious about the limit in Release:

At 10,000 Flies, slow down could be detected, but the game still handles nearly the same. It is a bit harder to make out the player’s Flea though… In any case it is an impressive ramp up to show to people in person going from 10 to 1,000 to 10,000. Each Fly uses a random number once per frame to determine a change in velocity. Each Fly is checked against each block for every frame for collision (as long as it hasn’t landed or already collided), and each bullet existing is checked against every Fly until it has been absorbed by the correct number of Flies. So there is a lot going on before even drawing each of the objects. I may make a recording of playing through this version and killing all the Flies, but it takes a while, which is why I didn’t already make that video.

January 2, 2013

The next step was to allow a bit more control over the Fly swarms for future level layouts by getting them to stay in a relative location. I decided on a bounding box logic that prevents acceleration away from the box if a Fly is outside of it. So eventually the Fly returns back to the box, but it is a pretty elastic effect as you can see in the video. I also decided Flies were really hard to hit on purpose, so they got slowed down a few pixels per frame. Combined with the swarming they are pretty easy to mow down. Ultimately the difficulty of the game would be mostly determined by maneuvering through the stage and in doing so efficiently while also killing as many Flies as possible, probably under a time limit.

January 7 and 9, 2013

There is a video for the version compiled for the 9th on Youtube, but given the length of this page and the visual impact of the change I’m not embedding the video here. On the 7th, I added some debugging logic because someone from work’s computer would not start the program and I couldn’t figure out what the problem was. I never did resolve that issue for her. On the 9th, I added the logic for states so that the game could be replayed after you lost without restarting the application. This was sort of a place holder for adding in a menu system.

March 14 and 17, 2013

There are three versions from these two days. On the 14th, I had a menu object created and in place as both a Main Menu and as an In-Game Menu. Implementing the menu object was a tedious and rather boring process which is part of why there was such a large gap in time since the last version of the game.  With the Main Menu in place, it was starting to feel like a real game with the familiar structure in place around the game play.

As a reward to myself, I had also added a new weapon type for the Flea; Grenades! But at first they were duds and didn’t even explode plus you could only have one grenade in play at a time. They were pretty inferior to the regular bullets which can kill 3 Flies before they are destroyed. The second version created on the 14th had explosions, but no collision logic employed for them, so the grenade was still an inferior weapon to the regular bullets.

By the 17th, I had finished turning Explosions into objects that could be collided with and it became a decent weapon choice if you could get close to the heart of a swarm. In even tighter spaces it would be even more useful.

April 12 2013

My time spent working on the game was in a bit of decline at this point, but I focused on getting the mouse working with the menu system since I had already started doing this with the original menu implementation. That is really the only change at this point other then some bug fixes which is an ongoing process.

NOW

The FleaGame has some unfinished blood droplet code in place from late April because a number of people that I showed it to said they expected something more interesting when a Bullet or Explosion killed a Fly. The plan there is to have 3 small red circles spawn where the Fly is killed and travel with a trajectory dependent primarily on the force from the Bullet/Explosion. Then they will stick to the first surface they collide with until they timeout and disappear. I got side-tracked by the decision to create this website and the regular happenings of the adult life so things haven’t changed since April.