View Full Version : [AS3] Flash Game Structure Question

12-19-2009, 09:45 AM
Hi guys! Just a question about the structure for a flash game.....

In a simple flash game, we would have many interfaces, ie Main Menu, Pause Game menu, Tutorial page, Game Over screen and the main game engine itself.....how do you usually lay them out?

Do you have a "Main" class that contains all those interfaces and the game engine? Because thats what i usually do....but then there is this approach that places the screens on the timeline, which is easier to implement, but then it would just be like doing it all on the timeline, which isn't tidy. I've searched around but couldn't quite get a satisfactory answer to this.

Opinions please? thanks alot!

12-19-2009, 01:37 PM
hi acidleaf
i have my own solution for flash game and other flash project.

1-use helper.as for helper and common function declaration like move(mc:movieClip);
2-At first determine how level your game has ?
if it whill be played over web you can program every level in single swf file
and else every level in single scene .

3-write action in plank layer and set characters and other movieClips to other layer for example :
[global variable] is a layer in which variables has benn defined and whit any displayOBJ in it .
[hero] is a leyer too and my hero movie clip is in this layar and whit any actionScript code.

4-set comment for every function , global variable , and object like this :
var point:int = 0;
// use on : [heroActionCode]layer , [main]layer line 44
//modifie in : [enemy]layer line 25

this sample is for a global variable like points .

5-program evrey level completely and then perform graphics work

finaly work whit group in start and evry one think as hero or enemy
i mean that you program hero and your frind program enemy( be carfull : use difrent instance name and regard incapsulation )

i hope it was helpfull.
at the end
think about palestinan child . they whill kill for holocast which is hapened in europe

12-20-2009, 01:03 AM
thanks for the reply mralesi. may i ask you what other functions does your helper.as class has?

and you seem to be depending on alot of timeline code in your project?