Link to Flash file:
https://sites.google.com/a/sou.edu/austin-gurwell-s-sfws/sfw-files/Maze.fla
Project 5: First Game
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.ui.Mouse;
import flash.media.Sound;
public class GameTime extends MovieClip {
//Global Variables
var player:MovieClip;
var ball:MovieClip;
var birdsArray:Array = new Array;
var vx:Number=0;
var vy:Number=0;
var maxAngle:Number;
public var speed:int;
public function GameTime()
{
// constructor code
//Make birds
makeBirds();
//Hide the mouse
Mouse.hide();
// Fill variables
player = new Snake;
ball = new Apple;
ball.vx = 5;
ball.vy = 5;
maxAngle = 15;
trace("Les do dis!!!");
//Add stuff to stage
addChild(player);
addChild(ball);
player.x = stage.stageWidth * .5;
player.y = stage.stageHeight * .85;
ball.x = stage.stageWidth * .5;
ball.y = stage.stageHeight * .1;
player.scaleX = .2;
player.scaleY = .2;
ball.scaleX = .15;
ball.scaleY = .15;
//event listeners
addEventListener(Event.ENTER_FRAME, onEnterFrame);
} //end constructor function
//Event Handler and other functions
function makeBirds():void
{
for (var i:int = 1;i>=0;i--){
var tempThing:MovieClip;
tempThing = new Thing();
tempThing.y = Math.floor(Math.random()*stage.stageHeight);
tempThing.x = Math.floor(Math.random()*stage.stageWidth);
tempThing.vx = 3;
tempThing.scaleX = .2;
tempThing.scaleY = .2;
trace("tempThing"+i+"vx = " + tempThing.vx);
trace("tempThing"+i+"vy = " + tempThing.vy);
addChild(tempThing);
birdsArray.push(tempThing);
}
}
function onEnterFrame(event:Event):void
{
{
// move things
moveThings();
moveThing(ball);
player.x = mouseX;
player.y = mouseY;
boundaryBounce(ball);
checkCollision(player, ball);
}
function moveThings():void
{
var tempThing:MovieClip;
for (var i:int = birdsArray.length-1;i>=0;i--){
tempThing = birdsArray[i];
tempThing.x -= tempThing.vx;
}
}
function moveThing(objectA:MovieClip):void
{
objectA.x += objectA.vx;
objectA.y += objectA.vy;
}
function checkCollision(objectA:MovieClip, objectB:MovieClip):void
{
if(objectA.hitTestObject(objectB))
{
objectB.vy = -objectB.vy;
objectB.vx = getCollisionAngle(objectA, objectB);
}
}
function getCollisionAngle(objectA:MovieClip, objectB:MovieClip):Number
{
//returns a new objectB.vy based on where objectB hits objectA
var relativeX:Number = objectA.x - objectB.x;
var relativePercentage:Number = (relativeX/objectA.width)*2;
if (relativePercentage > 1)
{
relativePercentage = 1;
}
if (relativePercentage < -1)
{
relativePercentage = -1;
}
var newVx:Number = -(relativePercentage * maxAngle);
// DEBUG CODE
if (objectB.x < 0)
{
objectB.x = 1;
objectB.y = objectA.y - 20;
}
if (objectB.x > stage.stageWidth)
{
objectB.x = stage.stageWidth-3;
objectB.y = objectA.y - 20;
}
return newVx;
}
function boundaryBounce(objectA:MovieClip):void
{ //STAGE COLLISIONS
if(objectA.x > stage.stageWidth || objectA.x < 0)
{
objectA.vx = - objectA.vx;
}
if(ball.y > stage.stageHeight || ball.y < 0)
{
objectA.vy = -objectA.vy;
}
}
}
}
}
Project 4: Animation Nation
Check it.
It's hard to recall three interactive events in my life that touched me the most. But I'll try.
1. Going to Disneyland for the first time when I was eight years old. Never in my life up to that point had I been able to interact with so many different fun, physical, real things. Disneyland has been dumbed down a bit over the years, and I was lucky enough to have had the chance to see Tom Sayer's Island in its fully open, explorer-friendly form.
2. Playing Grand Theft Auto III for the first time. This was back in my middle school days. The PS2 had just come out and people were unsure of what GTA3 would be. I hadn't been following the game closely before its release and rented it after it came out. Love at first car jacking. Never had I played a game that offered so much freedom to the player and with such amazing humor. I quickly bought the game and for weeks my friends and I talked about nothing but GTA. "So what did you do in GTA last night?" "I hit an old lady in the face with a baseball bat."
3. Dark Brotherhood quest in ESIV Oblivion where you're locked in a house full of people you need to kill. This quest in Oblivion made me really appreciate the amount of work that goes into games that most people will overlook and never see again. The quest begins with the player entering an old manor. The owner has set up a "contest" for some acquaintances he needs to get rid of. He has told them that treasure has been hidden somewhere in the house but that nobody can leave until it's found. The player assumes the roll as one of the contestants but must kill each person. What's amazing about this quest is it can be done in literally DOZENS of ways and each one is totally different. If you make friends with someone in the house, they will be more likely to suspect someone else of a murder instead of the player. And if they're convinced they know who the murderer is, they'll attack that person. Depending on the friends or enemies you make within the house, it's different every time.
There are probably much more significant events than these but these are what came to mind.


































