A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11303 Flash Movies | 7 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: VICENTE VERGARA SILVA
» Title: JORGE ASBUN BOJALIL WEBSITE INTRO
» Description: THIS IS BRIEF A 3D INTRO MADE IN 3D MAX STUDIO FOR A PERSONAL POET WEBSITE. ENJOY.
» More by VICENTE VERGARA SILVA


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6010 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: 3D Jobs
» Description: Free job forum for jobs in Films, Video Games, Multimedia and jobs in flash animation and scripting.


Random Links | Add your own Flash Related Links
Flash Tutorials 1255 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make flash video player for broadcasting live streaming video / TV on website
» How to convert the project file of Flash Demo Builder 2.0 into FLV file
» FLV to PSP for Mac - How to convert YouTube video to PSP on mac
» How to Convert FLV to MP4 for Playback on iPod
» how to download and convert youtube video to AVI with Leawo Free FLV converter
» Flash Multi-player Game Tutorial - TicTacToe
» How to make Flash elearning tutorials with screen recorder?
» Fader API:Slideshow with MovieClips on stage
» How to convert MS PPT file into an FLV File
» Unknown Tag: Title10
Random Tutorial | Add Site

Network Design Manager
The Computer Merchant, Ltd
US-VA-Hampton

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories How to Make Your First Game in Flash 8
Author: Luke Knepper | Website: http://zazeran.com |

 
Page 1
1 2 3 next»

Hi! This tutorial will teach you how to make a basic space invaders game a lot like this one in Flash 8. So, let's get started!

First you will need to set up your main timeline. You will want to select the size, by clicking on the button in the bottom inspector. A good size varies, for a space invaders game 600x600 would probably be pretty good. I suggest you make multiple layers (click on the new layer button in the timeline at the top), at least two named "game" and "background" and you may have even more, but this is not mandatory, it just makes the game more organized. Next, make a second and third key frame in ALL of the layers. Now you should have three frame sequences. In the top frame of each sequence, put the code "stop()" (click on the frame and press F9 to open up the code editor). In the first frame, also put this code: "var score: Number = 0" and on a newline "var life: Number = 100". What this does is make to variables, score and life, that can be accessed anywhere in the game. You can do this for as many variables as you want if your games get complicated. To access these variables through code, just put "_root.varName". (Note: In a specific symbol / object, you can make a variable just by typing the name and setting it equal to anything. However, this variable is only easily accessed by the specific object, so it is better to make a global variable in the main timeline.) The first frame will be the opening screen. You may design this however you want, putting the title and a bunch of cool effects, but you must have a button. Before you design anything make a button using the drawing tools that you want to be the start button. (Note: If you have any text make sure to select it and press Ctrl+B twice to break it apart!) Now select the whole button image and press F8. This will convert it to a symbol. As a name type "Start btn" and check the button type. now your drawing will be highlighted in blue. Select it, and press F9 and insert the following code:

on(release) {
gotoAndStop(2)
}

This means "When the button is released from a mouse press, go to Frame 2 and stop." If you test run your game, you will see that the button disappears when you click it! This is because the button is not in the second frame. Now make a game over frame in the third one. To make a text field that shows your score, choose the text field tool, and draw one. In the bottom, with the field selected, choose "Dynamic Field" and under the "Var" field put "score". Now that you have the basics set up, you will need to make the following sprites as movie clips: a tank sprite (you), a bullet sprite (your bullet), a ship sprite (the invader(s)). To make a new symbol (sprite) press Ctrl+F8. Then select "Movie Clip" and type in the sprite's name (i.e. tank, ship1...). Now that you have those done, go back to the main timeline. In the second frame (the game frame) place the bullet off the stage (drag and drop the bullet symbol from the library, the left inspector), the tank on the stage at the approximate y location you want it, and the invader off the stage. Next I will show you all the code you need to add!

1 2 3 next»

» Level Basic

Added: : 2006-12-13
Rating: 5.25 Votes: 24
Hits: 2673
» Author
Luke is an active Java, PHP, and Flash programmer, website designer, and game developer. Has much programming experience.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments