FinalDirections-Spring2012

=Directions for Spring 2012 FInal=

Studio 2 & 5 - May 30, 2012
Create a virtual Game of Tag. Save and eFile as ** TagGame-YourName.fla ** (red) Upload here as ** TagGame-YourName.swf ** (white) Verify you uploaded it correctly > IMPORTANT NOTE - the new character should move in place (as if it is on a treadmill).
 * 1) Create a second character that will be used with your Interactive Character Animation.
 * 2) Make the second character a symbol.
 * 3) Create an animation inside the new charcter symbol to create the illusion of movement.
 * 1) Use different keys to control the new character W - Up, S - Down, A - Left, D - Right.
 * 2) Use HitTest to make something happen if one character tags the other.

- Start File with MiniFig, Hole and all Script except HitTest, click to download. To move you second character, download the file above and copy the script from lines 8 - 30. Make sure your instance name matches the instance name you use in the script.

Alternate Directions Interactive Animation-Hit

Resources
Part 1: Basic Character Programming - from FlashGameTuts AS2 - Keyboard Events - Looks very promising MiniFig example (in class)

Studio 1 - May 29, 2012
Make a game that works similar to Angry Birds. Save and eFile as** ABGame-YourName.fla ** (red) Upload here as** ABGame-YourName.swf **(white) Verify you uploaded it correctly.
 * 1) Create a character that is the bird that you are launching. Make it a symbol.
 * 2) Create a launching mechanism - sling shot, cannon, catapult, etc...
 * 3) Create a target.
 * 4) Use ActionScript to make the character fly in an arc across the screen.
 * 5) Use ActionScript to determine if the character that you launched hits the target.

Resources
Events Conditionals HitTest

Script
``//`` This code is only executed once, when the movie first runs var xSpeedInitial:Number = 50; var ySpeedInitial:Number = 0; var aimDegrees:Number = 0; var canonAngle:Number = 0; ``//`` stops bird_mc animation initially bird_mc.stop; ``//`` This code is executed every frame using the onEnterFrame canon_mc.onEnterFrame = function { if (Key.isDown(Key.UP)) { aimDegrees -= 1; aimCanonDegrees(aimDegrees); } else if (Key.isDown(Key.DOWN)) { aimDegrees += 1; aimCanonDegrees(aimDegrees); } if (Key.isDown(Key.SPACE)) { launchBird(xSpeedInitial, ySpeedInitial); } }; function aimCanonDegrees(canonAngle) { trace("Angle = " + canonAngle); canon_mc._rotation = canonAngle; canonAngleRadians = canonAngle * (Math.PI / 180); ySpeedInitial = Math.tan(canonAngleRadians) * xSpeedInitial; trace("ySpeed = " + ySpeedInitial); } function launchBird(xSpeed, ySpeed) { bird_mc.onEnterFrame = function { bird_mc._x += xSpeed; bird_mc._y += ySpeed; ``//`` change the ySpeed by gravity, in this case 5 ySpeed += 5; }; }