-
Hiyas,
How do you all store your variables / functions in games?
I'm trying to make it object based wherever possible.
I was reading some tutorials from Colin Moock and he keeps all functions in one movie and variables in another. I guess this only really works for global functions as otherwise you would be passing around things like crazy.
What do you all do for variable/function storage etc?
Just trying to make my flash as clean as possible and want some "expert" opinion on the matter.
cheers,
DigiDino
-
Whatever makes sense to you. Since you're the one who will be writing it.. and going back to make changes.. hunting down a bug.. etc. I would say.. just arrange it in any way that makes sense to you.
Object based is good, whenever possible. Sure, I recommend keeping common functions in their own movie clip or even their own movie. But most of the functions tend to be very game-specific, and they simply would not be reusable anywhere else. I personally like to keep those functions right within the frames/buttons of the game (it saves all those "Call(thisfunction)" statements, which just makes it that much harder to track down bugs, imho).
As far as variables are concerned.. I personally like to keep them also within the movie/movie clip that I am working with. Trying to keep variables in their own movie just results in a lot of extra path typing ("_level2/shared/gamevars:varX" instead of "varX", yuk).
But it's mostly a matter of personal preference. Just go with what feels right to <b>you</b>.
imho
<EMBED src="/cgi-bin/ubb/Members/sigs/00000205.swf" quality=high WIDTH=500 HEIGHT=50 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED>
-
Yeah, cheers for your input.
Think I'll go for a global variables movie at level0 and then local everything else.
Should make it easier if I want to move movie clips about etc....but why I would want to do that I just dont know as that would be a *bad* game design at the start
Hopefully have some games to show you soon.
DDino
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|