Developing a Flash game from scratch - part 1

It begins. So far it’s going pretty well, although I realise that this is only early days. I found a great tutorial from Emanuele Feronato which explains a neat method of moving the ball around using the mouse and a range/angle gizmo. With a few very simple graphics there is the beginning of a simple game on the stage (that’s a new term for me!).

Here’s a list of what’s been added in the order it was done:

  • Ball can be fired upwards only
  • Gravity causes the ball to fall
  • Ball can bounce off the floor
  • Ball can’t leave the edge of the screen and bounces back
  • Friction affects the ball when it hits the ground only
  • Background added

I’m pleasantly suprised to see that most of the actual game mechanics is maths within the ActionScript. The beauty of this is that it will be nice and easy to change the physics of the ball.

So, now that I know a little bit more I want to add a few more features to the game:

  • Game can have different characters (balls) with different physical attributes (stickiness, coefficient of restitution bounciness etc.)
  • Perhaps at the end of each level/groups of levels the ball is replaced with another with different attributes. Hey, give the balls eyes and suddenly there’s a potential plot line to the game!
  • Possible parallax scrolling of the background (anybody who’s old enough to remember Shadow of The Beast on the Amiga will know what I’m looking to achieve)

Current bugs:

  • Ball doesn’t always bounce off sides or bottom
  • Ball sometimes gets stuck at side of screen

I’m not too fussed with fixing these bugs at the moment, I think they’re something to do with the ball going past the defined edge of the screen or floor. Meh, I’ll investigate that one later!

Here’s the current SWF for your enjoyment. Excuse the graphics but at the moment there’s not much point doing anything decent. More soon…

Leave a Reply