A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11249 Flash Movies | 9 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: kyo
» Title: building estructure
» Description: explosion of building estructure made by swift3D
» More by kyo


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Webdancer's Web Site
» Comments: Webdancer's, an artistic adventure in 3d graphicsbr>


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

» Let Photos Show Your Happy Family this Christmas and Upload YouTube
» PowerPoint show to DVD slide show--- PPS to DVD
» How to burn FLV to DVD for Mac
» How to Create Christmas Flash Greeting Ecard with photos and music
» Getting Started In Flash
» How to convert FLV video to MP3 audio for Mac OS
» Join flv videos together with just a few clicks
» How to convert flv file to avi for mac os x
» How to Create Christmas Flash Greeting eCard without programming skills
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Senior Web Designer
Aquent
US-GA-Atlanta

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.72 Votes: 215
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
 
   
 

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES