failure message! LOSE CONDITIONS THAT MEANS IT'S A GAME

This commit is contained in:
Jeremy Penner 2011-08-22 17:40:14 -04:00
parent 0e0753e1d7
commit 6647da51d0

View file

@ -5,6 +5,10 @@ package
import flash.events.Event; import flash.events.Event;
import flash.events.MouseEvent; import flash.events.MouseEvent;
import flash.geom.Point; import flash.geom.Point;
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
/** /**
* ... * ...
* @author jjp * @author jjp
@ -14,11 +18,14 @@ package
private var videotube:Videotube; private var videotube:Videotube;
private var gamedisc:Gamedisc; private var gamedisc:Gamedisc;
private var clickarea:ClickArea; private var clickarea:ClickArea;
private var textDeath:TextField;
public function GamePlayer(videotube:Videotube, gamedisc:Gamedisc) public function GamePlayer(videotube:Videotube, gamedisc:Gamedisc)
{ {
this.videotube = videotube; this.videotube = videotube;
this.gamedisc = gamedisc; this.gamedisc = gamedisc;
clickarea = null; clickarea = null;
textDeath = null;
addEventListener(Event.ADDED_TO_STAGE, init); addEventListener(Event.ADDED_TO_STAGE, init);
} }
private function init(e:Event):void private function init(e:Event):void
@ -37,7 +44,7 @@ package
videotube.removeEventListener(EventQte.QTE, onQte); videotube.removeEventListener(EventQte.QTE, onQte);
} }
private function onQte(e:EventQte):void private function onQte(e:EventQte):void
{ {
clearClickarea(); clearClickarea();
clickarea = new ClickArea(e.qte.rgpoint, 0xffff00, 0.7); clickarea = new ClickArea(e.qte.rgpoint, 0xffff00, 0.7);
addChild(clickarea); addChild(clickarea);
@ -46,7 +53,16 @@ package
{ {
if (clickarea != null) if (clickarea != null)
{ {
// fail videotube.pause();
textDeath = new TextField();
textDeath.htmlText = "<p align='center'>YOU ARE DEAD</p>";
textDeath.wordWrap = true;
textDeath.background = true;
textDeath.backgroundColor = 0x0000FF;
textDeath.width = stage.stageWidth;
textDeath.height = stage.stageHeight;
textDeath.setTextFormat(new TextFormat(null, 164, 0xFF0000));
addChild(textDeath);
} }
clearClickarea(); clearClickarea();
} }