Saturday, February 13, 2010

Colors - My First ActionScript 3.0/Flash Game

A few of my colleagues had told me how much they enjoyed working with ActionScript 3.0 and Flash and that I had to try it for myself. Though I have only experimented with a few of it’s features, I can easily say that I am hooked.

I decided that my first AS 3.0 project should be a relatively simple game, one with only one or two main goals. I went with a color-oriented game. The goal of this game is to fire bullets of matching colors at the falling objects. Each object destroyed increases the players score.

During the development of this game the biggest issue I encountered was getting used to AS 3.0’s syntax. I found myself declaring a variable, then finding out later I used standard C/C++ syntax. For Example:

C/C++

int x = 0;

ActionScript 3.0

private var x:Number = 0;

The other concept that initially threw me for a loop was the notion of the Library. When you draw an object to the stage in flash, you can highlight it and convert it to a symbol. Each Symbol can be a Movie Clip, Button, or Graphic, each with their own distinct properties. These symbols can be referenced in ActionScript 3.0 for use as game objects. This game only used two symbols, both of them movie clips. These symbols were Hero and ColorOrb.

It took about 3 hours for this project to be fully playable. If you want to try it out for yourself you can play it at:

http://rawkgamer.no-ip.biz/FlashGames/Colors.swf

Controls:

W/S – Cycle Colors

A/D – Move Left/Right

Space – Fire Bullets

[Via http://ggammon.wordpress.com]

No comments:

Post a Comment