initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.MainMenu;
|
||||
import com.arc.dh.state.StoryMode;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class CompleteWindow extends ArcGroup
|
||||
{
|
||||
|
||||
protected static const sprite:Class = CompleteWindow_sprite;
|
||||
|
||||
private static const FADE_SPEED:Number = 2;
|
||||
|
||||
private var _window:ArcSprite;
|
||||
|
||||
private var _diamonds:ArcGroup = new ArcGroup();
|
||||
|
||||
private var _enemies:ArcGroup = new ArcGroup();
|
||||
|
||||
private var _time:ArcGroup = new ArcGroup();
|
||||
|
||||
private var _heart:ArcGroup = new ArcGroup();
|
||||
|
||||
private var _red:ArcGroup = new ArcGroup();
|
||||
|
||||
private var _continue:FlxBitmapText;
|
||||
|
||||
private var _complete:Boolean = false;
|
||||
|
||||
private var _fading:Boolean = false;
|
||||
|
||||
public function CompleteWindow(param1:String, param2:String, param3:String, param4:String, param5:String)
|
||||
{
|
||||
super(71,74);
|
||||
this._window = new ArcSprite(0,0,sprite);
|
||||
this.add(this._window);
|
||||
this.addGroup(this._diamonds,21,40,60,"Diamonds",param1);
|
||||
this.addGroup(this._enemies,92,40,56,"Enemies",param2);
|
||||
this.addGroup(this._time,148,40,72,"Total Time",param3);
|
||||
this.addGroup(this._heart,27,61,91,"Heart Crystals",param4);
|
||||
this.addGroup(this._red,116,61,91,"Red Diamonds",param5);
|
||||
this._continue = new FlxBitmapText(0,82,Fonts.font(Fonts.BEVEL_BLUE),"CLICK TO CONTINUE","center",217);
|
||||
this.add(this._continue);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
alpha = 0;
|
||||
}
|
||||
|
||||
private function addGroup(param1:ArcGroup, param2:int, param3:int, param4:int, param5:String, param6:String) : void
|
||||
{
|
||||
var _loc7_:FlxBitmapText = new FlxBitmapText(param2,param3,Fonts.font(Fonts.SMALL_WHITE),param5.toUpperCase(),"center",param4);
|
||||
param1.add(_loc7_);
|
||||
var _loc8_:FlxBitmapText = new FlxBitmapText(param2,param3 + 8,Fonts.font(Fonts.SMALL_WHITE),param6.toUpperCase(),"center",param4);
|
||||
_loc8_.alpha = 0.8;
|
||||
param1.add(_loc8_);
|
||||
this.add(param1);
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var order:Array = null;
|
||||
var o:* = undefined;
|
||||
if(!this._complete)
|
||||
{
|
||||
order = [this._window,this._diamonds,this._enemies,this._time,this._heart,this._red,this._continue];
|
||||
for each(o in order)
|
||||
{
|
||||
if(o.alpha < 1)
|
||||
{
|
||||
o.alpha += FADE_SPEED * FlxG.elapsed;
|
||||
if(o.alpha > 1)
|
||||
{
|
||||
o.alpha = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
this._complete = true;
|
||||
}
|
||||
else if(!this._fading)
|
||||
{
|
||||
if(FlxG.mouse.justPressed() || FlxG.keys.justPressed("SPACE") || FlxG.keys.justPressed("ESCAPE") || FlxG.keys.justPressed("ENTER"))
|
||||
{
|
||||
FlxG.camera.fade(4278190080,0.5,function():void
|
||||
{
|
||||
var _loc1_:int = Data.state is StoryMode ? 3 : 0;
|
||||
FlxG.switchState(new MainMenu(_loc1_));
|
||||
});
|
||||
this._fading = true;
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user