Groups | Blog | Home
all groups > flash actionscript > january 2006 >

flash actionscript : Flash game design


tralfaz
1/25/2006 3:02:43 PM
[quoted text, click to view]


Learning by example is the easiest way to go. Find some games that
are like what you want to do and study them to see how they work.
Here is one site where the guy has made many games and posted them
with sourcecode. It's a very good recourse..
http://oos.moxiecode.com/

Go to Actionscript.org and look at the information on collision
detection in intermediate level tutorial 20 and beginning level
tutorial 38 "Building Games in Flash MX"
http://www.actionscripts.org/tutorials.shtml
That site should be a gold mine of resources for you.
good luck,
tralfaz

tralfaz
1/25/2006 3:55:48 PM
[quoted text, click to view]

Sorry, that collision detection tutorial isn't a good one.. it's too
old.

This is a book that I bought awhile back that has lots of game
examples..
"Flash MX for Fun and Games"
If you go to the site for the book you can look at and play the games
that the book shows you how to make...
http://www.garyrosenzweig.com/books/book9.html
You can test the games at that site to see if you want to get the
book.
There is an old Flash 5 version, an MX version and probably an MX2004
version.
tralfaz

Lzhang
1/25/2006 10:05:16 PM
Being an amateur Flash developer, I naturally want to try to make a game of my
own. I did, if not completely successfully develop a control for my game
character. It could walk with ease but when it comes to jumping, sometimes
impossible things happen, with the character getting stuck in the air or
dramatically change position. I created the basic controls with on.KeyPress but
because I wanted gravity I created movie clips to be played when someone clicks
the up arrow and when someone clicks the up and right(or left) arrow at once to
make the character jump in that direction and fall back to the ground. The
effect isn't working so well, am I on the right track? Or completely off?

Also, i have had no clue on how to create obstacles in the game so that the
chracter cannot simply walk over an object. i tried hitTest, when a character
hits an obstacle, i tried to disable a certain keymovement. But that brought
many bugs and impossibilities. I am fresh out of ideas, can someone help me
out?

David Stiller
1/25/2006 10:17:39 PM
I second all of tralfaz's recommendations. The Gary Rosenzweig book is
very good for certain kinds of games -- slide back and forth to catch
things, whack-a-mole, etc. -- and honestly, the Flash 5- and Flash MX-era
ActionScript still works just fine. Between the two of those, I would
definitely go with the MX version: MX brought with it the ability to forego
on() and onClipEvent() in favor of dot notation event handlers. It just
depends on how serious you want to get about game creation. With each new
version of Flash, ActionScript has improved, sometimes dramatically.
Nowdays, you can practically put all of your code (say, 95% of it) on a
single layer in a single frame, which makes it very easy to see where
everything is.

For games more along the lines of Mario Bros, the moxiecode site is more
a propos. Check out Tony Pa's "Tile Based Games," while you're at it ...

http://www.tonypa.pri.ee/tbw/index.html

For a much more general guide on the differences between ActionScript 1
and ActionScrip 2, see this good (but incomplete) introduction to
prototype-based OOP ...

http://www.debreuil.com/docs/

.... and compare it against the three-part ActionScript 2.0 primer by Joey
Lott ...

http://www.person13.com/articles/

.... I don't mean to swamp you with these, but it's very important you
understand the *concepts* of the game-specific tutorials: the concepts are
more important than the syntax, which has changed over the years.

Take the ideas you get in these tutorials, many of them unfortunately
old, and let the ideas spark you on to cleaner, more efficient ways ot
accomplishing your goals. Current best practices would be to use
ActionScript 2, which allows you class-based OOP syntax -- to my thinking, a
much more organized way to architect your logic.

In the very least, take advantage of the fact that the current
ActionScript Language Reference organized its code into classes. Classes
define an object by specifying its methods, properties, and events. Methods
are things the object can do; properties are the characteristics the object
has; events are things the object can react to. You'll see these headings
in namesake class entries for every object in ActionScript ... MovieClip,
TextField, Button, on and on. Arguably the most important class to learn is
the MovieClip class, since your compiled SWF itself is one big moie clip.

Since your game character is a movie clip, you'll want to have a handy
reference on all the qualities of a movie clip at your fingertips. The
"MovieClip class" is that handy reference.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."



[quoted text, click to view]
// etc.

Lzhang
1/27/2006 10:05:44 PM
AddThis Social Bookmark Button