Quick Article On Making A Flash Game

This step-by-step guide will show you how to make an Flash game quickly and easily

This article is for people who are just beginning to use Flash tools to create interactive stuff. This article will take you from a blank flash document to an action game in minutes, with any tricky things explained in ordinary, everyday language that you can skip over if you want.

So without further ado, let us fire up our favourite Flash tool. There are many tools available, so I will use Macromedia Flash as it is the most universally used tool.

I recommend Sothink SWF Quicker to budding flash designers for creating flash applications and movies. This program is like an easy to use version of Macromedia Flash, and I have used this versatile tool to easily make a variety of applications.

Setting the scene

Create a new flash document (menu File/New) and save it as game.fla. This is the design file that will contain the design and content for the game.

If you get stuck anywhere on this tutorial there is a finished game.fla at the bottom of this page that can be downloaded to see what things should look like.

Change the document properties (menu Modify/Document) so that the dimensions are 640 by 480 and so that the frame rate is 30 frames a second. The background colour is assumed to be white.

We will start by creating the 5 initial objects needed to make the game work.

Draw the player’s ship, the alien, the player’s projectile, the alien’s laser and an explosion on the same frame and layer.

Turn each drawing into a Movie Clip with its own instance name. I will explain below in more detail how this is done. More advanced people can skip to the naming of the instances.

How to turn a drawing into a Movie Clip:

1. Select the drawing by dragging a box around it.

2. Convert to a Movie Clip by going to the menu and then Modify or Insert depending on the Flash version. Choose “Convert to Symbol”. Alternatively you could use the shortcut by pressing F8.

3. Set the behaviour as Movie Clip and choose an appropriate name. This name is not the instance name. Click here for an illustration.

4. Select the new Movie Clip and in the properties panel at the bottom set the instance name to whatever is needed.

The instance names are below:

The Movie Clip for the player’s ship is called PlayerShip
The Movie Clip for the alien is called Alien
The Movie Clip for the player’s projectile is called PlayerShotT
The Movie Clip for the alien’s laser is called AlienShotT
The Movie Clip for the explosion is called ExplosionT

Notice how there is a T at the end of certain instance names. This is a convenience to indicate that objects with a T at the end are to be used as templates for copies of themselves. This will be explained later.

Let’s make things happen

We’ll create some basic behaviours for our Movie Clip objects next.

At the moment the player’s ship isn’t too responsive. We’re going to change that.

Left click on the player’s ship to select it. Go to the Actions panel at the bottom and enter in the following code in the white part on the right:

onClipEvent(enterFrame)
{
if(Key.isDown(Key.RIGHT)) {
//this will move the player 15 units to the right
this._x = this._x + 15;
} else if (Key.isDown(Key.LEFT)) {
//this will move the player 15 units to the left
this._x = this._x – 15;
}
}

I’ll give some explanation below as to what this code means. Feel free to skip ahead of this explanation if you don’t want to get heavily involved in ActionScript.

A bit about ActionScript:

onClipEvent(enterFrame){} This is basically a container that’s called a function. This container holds code to be run within it. The function isn’t executed or run until something else tells it to. “onClipEvent” is the name of the function. Some names such as “onClipEvent” are reserved by Flash in order for certain things to run properly.

The text in between the two brackets “(” and “)”are any parameters that are passed to the function. Parameters are passed from the source that executed it. There can be more than one parameter eg “(var1,test2)”. These parameters can usually be used within the function. Parameters will be described in more detail later.

The stuff in between curly braces “{” and “}” is the actual code within the function that is executed.

Things like “this._x= this._x + 15;” are called statements. Statements are bits of code that tells something to do something else. There is usually at most one statement every line. Every statement must end with “;” so that Flash knows when the statement ends.

Comments are ignored by Flash, but help the coder know what their code is doing. Comments begin with a “//” and continue for the entire line.

if(Key.isDown(Key.RIGHT)) {} This is called an if statement. This is basically a test to see if the stuff within the brackets is true. If the stuff is true then the code within the curly braces is run.

else if (Key.isDown(Key.LEFT)) {} This can only go after the “if” statement or another “else if” statement. Basically, if the stuff in the previous test is false, then the stuff in this “else if” statement is tested. If the test in the brackets is true than the code within the braces is executed.

This little piece of code will let you move the ship around from left to right. Preview your flash animation (CTR-ENTER) and try moving the ship with the left and right arrow buttons.

The ship can move outside the boundaries so we need to add in a bit more code to restrict its movement.

Change the line:

if(Key.isDown(Key.RIGHT )) {

to:

if(Key.isDown(Key.RIGHT) and this._x 0) {

Preview your animation again. This time the player ship should stay within the boundaries.

Now would be a great time to place the player’s ship around the bottom of the stage, as it will be firing upwards.

Time to breathe some life into the alien. Select the alien and put this code into the ActionScript part:

//this is triggered when the clip loads
onClipEvent (load)
{
xmove = random(15) – random(15); //comments can also go after statements
ymove = random(15) – random(15); //this sets the ymovement randomly
this._x = random(640); //this sets the x and y position randomly
this._y = random(480);
}

//this is triggered every time a new frame is entered, in this case 30 times a sec
onClipEvent (enterFrame)
{
//lets move the alien around
this._x = this._x + xmove;
this._y = this._y + ymove;

//bounce the alien if it is out of bounds
if(this._x > 640){xmove = Math.abs(xmove) * -1}
if(this._x 480){ymove = Math.abs(ymove) * -1}
if(this._y 0){
– PShotTimer;
}

//test for space key down
if(Key.isDown(Key.SPACE))
{
if(PShotTimer 480){this.removeMovieClip();}

//test to see if this is colliding with the player
col = _root.md(_x, _y, _root.PlayerShip._x, _root.PlayerShip._y)

//you can change 40 to another number if shots seem to pass through
if(col here

I hope you have enjoyed following this guide as much as I have enjoyed writing it.

After you have had a chance to sit back and absorb this article, please send us your comments and suggestions – your feedback is greatly appreciated.

Fun Outdoor Games and Tips

This weekend, instead of non-stop video games and TV, try turning your family onto some fun outdoor games.

You might be saying to yourself, “You don’t know my family. I’ll have a snowball’s chance in hell to get my family outdoors.” Don’t worry. The games and tips presented here will keep everyone engaged, having a blast and begging to play more.

Three Holes is a fun ball game for 2-10 players or more. You’ll need a hard dirt playing surface and a golf ball for every player. First make three shallow holes with your heel, all in a straight line with five to fifteen feet between the holes. Add a rolling line next to one of the end holes.

The object for each player is to roll his ball into each of the three holes two times. If he misses during any roll, his ball stays put and the next player takes a turn. The next player can roll his ball to the hole or to his opponents ball. This can be beneficial if the other players ball is closer than the hole. If he hits the ball he can throw from that spot to the hole and proceed to the next hole. When he lands in a hole, he rolls to the next hole by first placing his heel in the previously landed hole and rolling to the next.

Fun Outdoor Games Tip. Studies show that outdoor play is maximized when appropriate equipment and materials are combined with grown-up participation. So rather than sending your kids out to play, go toss a ball with them, play a chasing game or teach them some of the fun outdoor games from your childhood.

Three Deep is a fun tag game for children and adults. You’ll need at least 15 players. All the players except two form a double circle (couples), all facing inward, with one player standing behind another with about 3 feet between them. The two remaining players are designated as the chaser and the runner.

The object of Three Deep is for the chaser to tag the runner. Any runner may find refuge at any of the “safe points,” (inside the circle in front of any of the couples). The outer player (three deep) now becomes the runner and can now be tagged by the chaser but the new runner can’t take refuge with any couple to his direct right or left. When a chaser tags a runner, they switch places. Running through the circle is okay but no player may stop for refuge in the circle. Play until tired.

Fun Outdoor Games Tip. One of the main reasons families don’t have fun outdoors is because parents forget the purpose of going outdoors. That is to have fun. One way to avoid this breakdown is to have periodic fun checks. All you do is check from time to time that everyone is having fun. If a breakdown is identified, everyone works together to make things more fun. The fix might be a game change up or slowing down the pace of the game.

Stealing Sticks is a game for 10-30 or more players. First divide the playing field into two equal parts and mark a goal on the ground at the end of each side. Next, place six sticks at each goal. The object is for one team to acquire all the sticks. Whenever a player makes its safely to the other goal, he carries back one stick and is exempted from being tagged on the way back. If a player is tagged in the process of stealing a stick, he becomes a prisoner. Prisoners can be freed when tagged by another teammate and are exempt from being tagged on the way back. No sticks leave the goal area when players are in prison.

Fun Outdoor Games Tip. One way to maximize fun is to invite several families for a fun outdoor games night. Games can be much more fun as you add in some friendly competition. Next find some unique and super fun games. Finally pick a date, select the best park in town and have fun.

A Brief History of Online Games

Electronic gaming has evolved dramatically in recent years. As data bandwidth, processing power and screen resolutions steadily increase; developers are keeping pace to provide more realistic and immersive Internet entertainment experiences. It is hard to imagine a world without the wealth of online games that today’s web surfers have come to expect, but the history of online gaming goes back well before the mainstream adoption of the Internet.

The first games to be played over computer networks were developed in the early 1970s. These were built on multi-user timeshare terminals at universities. The latter part of that decade saw the arrival of multi-user dungeons (MUD,) which later evolved into multi-access dungeons (MAD) and massive multiplayer online role playing games (MMORPG.)

In 1985, the game Islands of Kesmai was released for users of the commercial CompuServe computer network. With graphics made up of ASCII text characters, this multi-player RPG bore little resemblance to the games of today; but in many ways, it was a precursor to the modern MMORPG. The fantasy role playing battles of this game were among the earliest ancestors of today’s online fighting games.

Later in the 1980s, the first games were developed which used the Internet Protocol (IP) to communicate. In 1991, the game Neverwinter Nights was released for AOL subscribers. This is widely hailed as the first 3D graphical MMORPG. As the Internet grew in popularity among the general public, the 1990s saw an explosion of role playing, shooter, strategy and online fighting games with multiplayer capabilities. Some of the most notable are Doom, Warcraft and Quake.

By the year 2000, most commercial game software packages featured the ability to play online against other players. Although many of the most popular online games were designed for multiplayer action, developers were quick to take advantage of Internet technologies such as Flash and JavaScript to create single-player games as well.

The year 2002 saw the launch of gaming networks such as XBox Live and Steam. As social networks grew in popularity throughout the decade, companies such as Zynga jumped on the bandwagon to create casual games that users could play against their friends. Today, the options for online gaming range from commercial software packages, to social network gaming, to browser based games and even mobile apps.

Gamers no longer need to subscribe to expensive online services or purchase commercial software packages to play online. For those who want a convenient and fun gaming experience, there are plenty of sites that offer online fighting games and a variety of other challenges that can be played right now, right in your web browser.