Flash game: Sonic falldown

This is a project I worked on for a couple of months to learn more about Flash programming and it was quiet interesting.

The game is very simple and addictive (well it is all about breaking your own high score), you have to keep moving if you do not want to get caught by the boxes. The speed may seems slow at the very beginning but the longer you play, the harder it will be, trust me on that.

I also implements bonus for the game to make the experience more attractive and less linear.

  • First of all, if you are in big trouble you can break the box right under your feet and have a chance to survive. Keep in mind that you will not be able to do so all over again (I thought that would be too easy for gamers like you ^^), you start with three break box bonus. Once you have completed five levels, you will gain a new break box bonus but you cannot keep more than three break box bonus so use them wisely.
  • You also have a speed bonus which will allow you to move faster for a few seconds and get you out of a nasty situation. You have three speed boost bonus for the whole game, do not waste them.

Here is a short snippet of the game loop which manages the rendering of the character:

/* Determine the state of the character and display the associate sprite. */
_state = "fall";
if(collision == true)
{
	_state = "stand";
	/* If the user press the right/left key the character is walking.
         * If the speed bonus is active a special sprite is display. */
	if(Key.isDown(Key.LEFT) == true || Key.isDown(Key.RIGHT) == true)
	{
		_state = (speedBonusEnable == true) ? "speed" : "walk";
		/* If the character as reach the limit of the animation he is stuck. */
		if(this._x-(this._width/2) <= 0+PADDING || this._x+(this._width/2) >= WIDTH_GAME-PADDING)
		{
			_state = "stuck";
		}
	}
}
displaySprite(_state);

There are some stuff to finish (bugs collisions, a pre-loader or a high-score handler).
Still, it is good enough for you if you want to have a good idea on how to develop games with Flash. Here is an archive with all the files of the project (sources files, images, sfx, etc).

Leave a Reply

Your email address will not be published. Required fields are marked *