Welcome to YLOAN.COM
yloan.com » Flash Game » Understanding Flash Game Development In An Easy Manner
XBOX PSP PS3 NDS Wii warcraft wow starcraft Flash Game

Understanding Flash Game Development In An Easy Manner

In case you are interested in casual mobile applications or Flash game development

but are new to Actionscript, don't worry, this text piece will be a real help. Here is described the simple use of code snippets panel (present in Adobe Flash Professional CS5.5) for creating Jewelry Heist (a popular mobile game). The Flash game development demonstration will help you in applying as well as modifying device-specific and common interactive code snippets for incorporating multiple features in the game.

The Code Snippets panel includes ActionScript 3 snippets, which are usually used in a variety of Flash projects such as games and banner advertisements. Before going further, it is vital for a Flash game developer to get acquainted with the Code Snippets panel as well as the prebuilt code so that it becomes easy for him/her to add them to the projects.

This Flash game development tutorial features the following code snippets:

Touch and Drag Event


Mouse Over Event

Countdown Timer

Stop At This Frame

Click To Go To Frame And Stop

Jewelry Heist is a game where a player needs to steal gemstones placed in a museum. The stealing has to be done without getting touched by the laser beams, which are in continuous motion.

Displaying instructions

To begin with, a Flash game developer needs to download JewelryHeist files and save it as JewelryHeist.fla extension. Open the file on Flash Professional. A thorough examination of main Timeline will help you to understand the construction of the finished project. FLA document of the game contains three frames. In the first frame you will find the game's instructions, in the second frame you will find the game's graphics and play logic, and in the third frame you will find the Game Over screen. It is must to add code to frame 1.

Handling Frame 1

A code needs to be inserted for pausing the play head at frame 1.

Locate and open the file named Frame1.fla. There is presently no code in this document

Click Frame 1 for positioning the playhead on Frame 1

Code snippets panel can be opened by choosing Window > Code Snippets

Move to in the Timeline Navigation category and double-click the Stop at This Frame snippet. The Actions panel will get opened to show the addition of Stop(); command

Adding code to Frame 2

Locate and open the file named Frame1.fla

Click Frame 2 in the Timeline, in the Action Layer

Select Gem 1 movie clip symbol, which is orange

Choose Window > Code Snippets to open the Code Snippets panel

Double click the option Touch and Drag Event Snippet

Repeat the above given steps for Gem 2 as well as Gem 3

Save and leave file

Updating laser beams while using Mouse over event snippet

Click on Frame 2

Select the Laser1Animation1 movie clip symbol

Choose Window > Code Snippets to open the Code Snippets panel

Go to Event handlers category and double click on Mouse over event snippet

Repeat above steps for Laser2Animation2 as well as the Laser3Animation3 movie clip symbols

Read all instructions and panel carefully

// Start your custom code

// This example code displays the words "Moused over" in the Output panel.

trace("Moused over");

// End your custom code

Defining the countdown timer snippets duration

To set playheads location, click Frame 2 of the Action Layers

Edit Actionscript in order to replace below given line:

var fl_SecondsToCountDown:Number = 10;

with this line:

var fl_SecondsToCountDown:Number = 1;

Again edit the code and replace below given lines:

trace(fl_SecondsToCountDown + " seconds");

fl_SecondsToCountDown--;

with this line:

gotoAndStop(3);

4. Save and close the file.

How to display Game over Screen

Locate and open the file named Frame1.fla.

To set playheads location, click Frame 3 of the Action Layers

Select Play Again on the Stage movie symbol.

Double-click the Click to Go to Frame and Stop code snippet.

Locate and Edit the below given line

gotoAndStop (5);

to this:

gotoAndStop (2);

Optimizing the final game

Locate and open the newly craeted Frame3.fla.

Place the playhead on Frame 3 by clicking Frame 3

Choose Window > Actions to open

Use following code at line 1

fl_CountDownTimerInstance.reset();

Update Quit Button

Set the playheads location by clicking Frame3 of Action layer

Select the movie clip symbol named Quit on the Stage

open, choose Window > Actions to open it. Write the following code at the bottom of the Script window:

Quit_MC.addEventListener(MouseEvent.CLICK, fl_CloseApplication);

function fl_CloseApplication(event:Event):void

{

NativeApplication.nativeApplication.exit(0);

}

Improving Game performance

Set the playheads location by clicking Frame2 of Action layer

Choose Window > Actions to open it

Write the following code at the bottom of the Script window:

function RemoveEventListener()

{

Laser1_MC.removeEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);

Laser2_MC.removeEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_2);

Laser3_MC.removeEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_3);

Gem1_MC.removeEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler);

Gem1_MC.removeEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler);

Gem2_MC.removeEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler_2);

Gem2_MC.removeEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler_2);


Gem3_MC.removeEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler_3);

Gem3_MC.removeEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler_3);

}

by: DavidJackson
A Brief Note On How Puzzle Games Are Beneficial For Toddlers These Awesome Barbecue Party Games And Activities Are Not Half Baked Disney Cars Games - Disney Cars Race Track And Disney Pixar Cars Movie Are A Hit For Kids Attend A Game Design Program That Focuses On Software Development Fun Betty Boop Theme Game Perfect For A Betty Boop Theme Party Saying Congratulations With Great Party Games And Printable Activities Canon Xa10 Professional Camcorder With 64gb Internal Flash Memory And Full Manual Control Video Gaming Does Not Have To Be Expensive If You Use A Gamefly Free Trial Three Exciting Games You Could Play Over The Phone Make The Most Of The Baby Shower With Free Baby Shower Games Ideas For First Communion Games And Printable Activities For The Whole Family Halloween Party Games Can Be Spooky And Fun Make A Memory With Games At A Chanukah Party
print
www.yloan.com guest:  register | login | search IP(216.73.216.15) California / Anaheim Processed in 0.023090 second(s), 7 queries , Gzip enabled , discuz 5.5 through PHP 8.3.9 , debug code: 176 , 6466, 24,
Understanding Flash Game Development In An Easy Manner Anaheim