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 Basic Shoot 'Em Up
Author: Jack Bowyer

 
Page 1
1

Okay, first of all to be able to do this you must know most of the basic actions in the action script window, and preferably the tell target action. You must also know about movie clips, buttons etc.

So, let's get started. The first thing you must do is create a movie clip and name it "Enemy". In the first 19 frames of the movie clip (It can be longer if you want) draw your enemy and make him stand there, reload his gun, eat something... whatever you want to make space inbetween when he shoots. Once you done that go to the next unused frame in the movie clip. Now over 5 or so frames make him fire his gun at you, on the final frame of this write the code in the frame actions box:

gotoAndPlay (1);

This will make it go back to frame one once he has fired. On the next unused frames you must draw him getting shot himself... the good bit! Now we must make an invisible button the exact shape of the enemy, do this by copying the shape of the enemy one frame one and pasting it into only the "hit" frame of a button symbol inventively named "button". Now go back to the first frame of "enemy" and create a new layer above the drawings. On this layer put the invisible button and make sure that it covers directly over the enemy. Add the action to this button:

on (release) { gotoAndPlay (31); }

The frame number 31 is where the enemy was shot in my one, but you may have to change this depending on where the enemy being shot starts.

Leave the enemy movie clip now and go to the main timeline. There should only be one frame here, on which you must put a "stop" action. In frame two create a "You win" screen. Add a stop action and create a restart button going back to frame one. Do the same for a you lose screen on frame three.

Now go back to frame one. Create a movie clip labeled "Health". In it's first frame you have full health- 100%, 5 green bars, a happy face- you get the idea. In this frame put a stop action. Make the next frame and make the health slightly lower- i.e 80% and do the same for the next few frames until it reaches 0 health, all with a stop ation on. (The more of theese frames you do the longer you live)On the 0 health screen dont do a stop action- instead write:

tellTarget ("_parent") { gotoAndPlay (3); }

This will make the main timeline go to the "you lose" screen.

Go back to the main timeline and name the healthbars instance name as "Health. Go into your enemy timeline and on the frame where his gun fires write the code:

tellTarget ("_parent.Health") { nextFrame (); }

This will tell the health bar to go to the next frame, lowering your health, if it reaches 0 it will make the main timeline go to the "you lose screen". Now go to the last frame of the enemy dying and write the code:

tellTarget ("_parent") { gotoAndPlay (2); }

This will make you go to the "win" screen if you shoot him.

Now for the custom cursor. Draw a crosshair and make it into a movie clip. Now paste it into the center of the first frame of your main timeline. In its actions write:

onClipEvent (enterFrame) { Mouse.hide(); } onClipEvent (load) { startDrag ("", true); }

This will hide the mouse and make the movie clip drag as if it was the cursor. The crosshair must be on a seperate layer above the enemy layer.

This is just the basics of a very simple shoot em up. In the next tutorial i will tell you how to add a lot more detail to the game. And just to make it seem even simpler to make i'll tell you that i am only 13 years old and i worked out the whole thing myself. There probably are better ways for the health bar and stuff but i'll leave that for the experts.

1

» Level Intermediate

Added: : 2003-06-05
Rating: 7.59 Votes: 225
Hits: 1257
» Author
Erm...
» Download
Download the files used in this tutorial.
Download (17 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