A Game in 5 Minutes

I decided to try to make a game in 5 minutes after seeing this by @weasello
Below is the video, below that is the .sfw, and belower that is the code I wrote
This was really fun to do and I can't wait to do a 5 min jam again.


Code

package {

import flash.display.*;
import flash.events.*;

public class Main extends MovieClip{

public var safe:Boolean = false;

public function Main() {
addEventListener(Event.ENTER_FRAME,onFrame);
win.alpha = 0;
}

public function onFrame(e:Event){
if(start.hitTestPoint(mouseX,mouseY)){
safe = true;
}
if(safe){
if(end.hitTestPoint(mouseX,mouseY)){
win.alpha = 1;
}
if(bad.hitTestPoint(mouseX,mouseY,true)){
safe = false;
}
}
}//end onds
}
}
Back to site