H A N G M A…You lost!

For our second project in Flash, we were assigned to create a game.  I had previously created a Frogger type game involving a fly and a windshield.  It used code to move the fly with the direction keys and a couple hit tests, but this project  needed to be more in depth.  After dabbling around a racing game and trying to make some AS2 work, I had to change my game.  I decided to create a game that would be very playable and nicely designed.  I settled on hangman.  The majority of the game was based upon .visible code.  I setup the hangman as a separate movie clip that would advance one frame for every incorrect guess.  I also setup the letters as individual buttons that disappeared after clicking.  The tricky part of the code was the separate scenarios that would result in a loss of a game.  Because no two people clicked the same letters, I had to use code I hadn’t before.  Here is the code:

addEventListener(Event.ENTER_FRAME,myFunction);

function myFunction(event:Event) {

if (answerr.visible==true && answerh.visible==true &&             answery.visible==true && answert.visible==true && answerm.visible==true)

mc_structure.gotoAndStop(9);

The only things I wished I did differently were that I used multiple frames, instead of loading each level as an independent .swf because it resulted in slightly off positioning.  I also wished I used an array with a random number generator to grab any given word.  Overall, I was very pleased with how it turned out, especially the design.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s