initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.arc.dh
|
||||
{
|
||||
public class Color
|
||||
{
|
||||
|
||||
public static const RED:int = 0;
|
||||
|
||||
public static const BLUE:int = 1;
|
||||
|
||||
public static const GREEN:int = 2;
|
||||
|
||||
public static const YELLOW:int = 3;
|
||||
|
||||
public static const PURPLE:int = 4;
|
||||
|
||||
public static const BLACK:int = 5;
|
||||
|
||||
public static const CYAN:int = 6;
|
||||
|
||||
public static const WHITE:int = 7;
|
||||
|
||||
public function Color()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.arc.dh
|
||||
{
|
||||
public class Gun
|
||||
{
|
||||
|
||||
public static const PRIME:String = "Prime Gun";
|
||||
|
||||
public static const PRIME_DAMAGE:Array = [20,30,60,90,130,170,210,250,290,330,370];
|
||||
|
||||
public static const PRIME_DELAY:Array = [0.3,0.28,0.26,0.24,0.22,0.2,0.19,0.18,0.17,0.16,0.15];
|
||||
|
||||
public static const PRIME_SPEED:Number = 500;
|
||||
|
||||
public static const SPREADER:String = "Spreader";
|
||||
|
||||
public static const SPREADER_DAMAGE:Array = [40,49,57,70,82,94,108,134,155,188,205];
|
||||
|
||||
public static const SPREADER_DELAY:Array = [0.38,0.36,0.34,0.32,0.3,0.28,0.26,0.24,0.22,0.2,0.18];
|
||||
|
||||
public static const SPREADER_SPEED:Number = 400;
|
||||
|
||||
public static const MISSILE:String = "Missile Launcher";
|
||||
|
||||
public static const MISSILE_DAMAGE:Array = [140,200,260,320,430,500,620,730,870,1000,1120];
|
||||
|
||||
public static const MISSILE_DELAY:Array = [0.7,0.67,0.64,0.61,0.58,0.55,0.52,0.49,0.46,0.43,0.4];
|
||||
|
||||
public static const MISSILE_SPEED:Number = 400;
|
||||
|
||||
public static const REBOUNDER:String = "Rebounder";
|
||||
|
||||
public static const REBOUND_DAMAGE:Array = [75,100,125,150,175,200,230,270,310,370,410];
|
||||
|
||||
public static const REBOUND_DELAY:Array = [0.34,0.32,0.3,0.28,0.26,0.24,0.22,0.2,0.16,0.14,0.12];
|
||||
|
||||
public static const REBOUNDER_SPEED:Number = 300;
|
||||
|
||||
public static const SPECIAL_ONE:int = 2;
|
||||
|
||||
public static const SPECIAL_TWO:int = 3;
|
||||
|
||||
public function Gun()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxObject;
|
||||
|
||||
public class Entity extends ArcSprite
|
||||
{
|
||||
|
||||
public var of:Function;
|
||||
|
||||
public function Entity(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2);
|
||||
this.of = Data.state is HorizontalMode ? this.ofh : this.ofv;
|
||||
}
|
||||
|
||||
public function handleCollision(param1:FlxObject) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function get outside() : Boolean
|
||||
{
|
||||
return this.of();
|
||||
}
|
||||
|
||||
public function ofh() : Boolean
|
||||
{
|
||||
var _loc1_:int = x / Config.BLOCK_SIZE;
|
||||
return _loc1_ <= Data.state.despawnTop - 2;
|
||||
}
|
||||
|
||||
public function ofv() : Boolean
|
||||
{
|
||||
var _loc1_:int = y / Config.BLOCK_SIZE;
|
||||
return _loc1_ >= Data.state.despawnBottom || _loc1_ <= Data.state.despawnTop - height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,705 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.state.TadpoleMode;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import com.arc.flixel.ArcU;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxSprite;
|
||||
|
||||
public class Player extends Entity
|
||||
{
|
||||
|
||||
public static const sprite:Class = Player_sprite;
|
||||
|
||||
public static const shieldSprite:Class = Player_shieldSprite;
|
||||
|
||||
private static const gunRightSprite:Class = Player_gunRightSprite;
|
||||
|
||||
private static const gunUpSprite:Class = Player_gunUpSprite;
|
||||
|
||||
private static const gunDownSprite:Class = Player_gunDownSprite;
|
||||
|
||||
private static const dotSprite:Class = Player_dotSprite;
|
||||
|
||||
private static const elevatorSprite:Class = Player_elevatorSprite;
|
||||
|
||||
private static const JUMP_HOLD:Number = 0.2;
|
||||
|
||||
private static const DOUBLE_JUMP_HOLD:Number = 0.03;
|
||||
|
||||
private static const TRIPLE_JUMP_HOLD:Number = 0.03;
|
||||
|
||||
private static const HIT_TIME:Number = 0.4;
|
||||
|
||||
private static const BASE_MOVE_SPEED:Number = 80;
|
||||
|
||||
private var JUMP_TIME:Array = [0.2,0.03,0.03];
|
||||
|
||||
private var _jump:Array = [0,0,0];
|
||||
|
||||
private var _jumping:Boolean = false;
|
||||
|
||||
private var _doubleJumping:Boolean = false;
|
||||
|
||||
private var _jumpTimer:Number = 0.2;
|
||||
|
||||
private var _doubleJump:Number = 0.03;
|
||||
|
||||
private var dots:Array = new Array();
|
||||
|
||||
private var dot:FlxSprite;
|
||||
|
||||
private var _startheight:int = 0;
|
||||
|
||||
private var _maxheight:int = 0;
|
||||
|
||||
public var invulnerable:Number = 0;
|
||||
|
||||
public var dashing:Number = 0;
|
||||
|
||||
private var _canDash:Boolean = true;
|
||||
|
||||
public var gun:String;
|
||||
|
||||
private var _inWater:Number = 0;
|
||||
|
||||
public var radians:Number;
|
||||
|
||||
public var lastHitLava:Boolean = false;
|
||||
|
||||
public var inHidden:int = 0;
|
||||
|
||||
private var _lastRight:Number = 0;
|
||||
|
||||
private var _lastLeft:Number = 0;
|
||||
|
||||
private var hitTimer:Number = 0;
|
||||
|
||||
private var gunDown:ArcSprite;
|
||||
|
||||
private var gunRight:ArcSprite;
|
||||
|
||||
private var gunUp:ArcSprite;
|
||||
|
||||
private var _shieldSprite:ArcSprite;
|
||||
|
||||
private var _shield:Number = 0;
|
||||
|
||||
private var _shieldParticle:Number = 0.3;
|
||||
|
||||
private var _shieldBlinkTimer:Number = 0;
|
||||
|
||||
private var _xray:ArcSprite;
|
||||
|
||||
private var i:int;
|
||||
|
||||
private var j:int;
|
||||
|
||||
public var hasGun:Boolean = true;
|
||||
|
||||
public var elevator:ArcSprite;
|
||||
|
||||
public var controllable:Boolean = true;
|
||||
|
||||
public function Player(param1:Number, param2:Number)
|
||||
{
|
||||
this.gun = Data.gun;
|
||||
super(param1,param2);
|
||||
loadGraphic(sprite,true,true,16,24);
|
||||
offset.y = 10;
|
||||
height = 12;
|
||||
offset.x = 5;
|
||||
width = 6;
|
||||
drag.x = 400;
|
||||
acceleration.y = 600;
|
||||
var _loc3_:int = 0;
|
||||
while(_loc3_ < 50)
|
||||
{
|
||||
this.dot = new FlxSprite(0,0,dotSprite);
|
||||
this.dot.alpha = 0.8 - _loc3_ * 0.016;
|
||||
this.dots[_loc3_] = this.dot;
|
||||
_loc3_++;
|
||||
}
|
||||
addAnimation("walk",[0,1,2,3,4],7,true);
|
||||
addAnimation("stand",[6,7],4,true);
|
||||
addAnimation("jump",[5]);
|
||||
this.gunRight = new ArcSprite();
|
||||
this.gunRight.loadGraphic(gunRightSprite,true,true,16,24);
|
||||
this.gunRight.offset.y = 10;
|
||||
this.gunRight.height = 12;
|
||||
this.gunRight.offset.x = 5;
|
||||
this.gunRight.width = 6;
|
||||
this.gunUp = new ArcSprite();
|
||||
this.gunUp.loadGraphic(gunUpSprite,true,true,16,24);
|
||||
this.gunUp.offset.y = 10;
|
||||
this.gunUp.height = 12;
|
||||
this.gunUp.offset.x = 5;
|
||||
this.gunUp.width = 6;
|
||||
this.gunDown = new ArcSprite();
|
||||
this.gunDown.loadGraphic(gunDownSprite,true,true,16,24);
|
||||
this.gunDown.offset.y = 10;
|
||||
this.gunDown.height = 12;
|
||||
this.gunDown.offset.x = 5;
|
||||
this.gunDown.width = 6;
|
||||
this._startheight = this._maxheight = y;
|
||||
new Date().getTime();
|
||||
this._shieldSprite = new ArcSprite(0,0,shieldSprite);
|
||||
play("stand");
|
||||
}
|
||||
|
||||
public function get moveSpeed() : Number
|
||||
{
|
||||
return (BASE_MOVE_SPEED + Data.agility * 5) * (this._inWater > 0 ? 0.5 : 1);
|
||||
}
|
||||
|
||||
public function get maxHeight() : int
|
||||
{
|
||||
return (this._maxheight - this._startheight) / -9;
|
||||
}
|
||||
|
||||
private function pressedJump() : Boolean
|
||||
{
|
||||
return FlxG.keys.justPressed("W") && Data.control != Data.CONTROL_KEYBOARDI || FlxG.keys.justPressed("SPACE") || FlxG.keys.justPressed("Z") || FlxG.keys.justPressed("UP") && Data.control != Data.CONTROL_KEYBOARD;
|
||||
}
|
||||
|
||||
private function pressingJump() : Boolean
|
||||
{
|
||||
return FlxG.keys.pressed("W") && Data.control != Data.CONTROL_KEYBOARDI || FlxG.keys.pressed("SPACE") || FlxG.keys.pressed("Z") || FlxG.keys.pressed("UP") && Data.control != Data.CONTROL_KEYBOARD;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var _loc1_:Array = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
if(Data.state.over)
|
||||
{
|
||||
alpha -= FlxG.elapsed;
|
||||
super.update();
|
||||
return;
|
||||
}
|
||||
if(y < this._maxheight)
|
||||
{
|
||||
this._maxheight = y;
|
||||
}
|
||||
if(this._shield > 0)
|
||||
{
|
||||
this._shield -= FlxG.elapsed;
|
||||
this._shieldParticle -= FlxG.elapsed;
|
||||
if(this._shieldParticle <= 0)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"rebound",getMidpoint().x,getMidpoint().y,1,1,0.5,0,-30,30,-30,30);
|
||||
this._shieldParticle = 0.1;
|
||||
}
|
||||
if(this._shield < 2)
|
||||
{
|
||||
this._shieldBlinkTimer -= FlxG.elapsed;
|
||||
if(this._shieldBlinkTimer <= 0)
|
||||
{
|
||||
this._shieldBlinkTimer = 0.1;
|
||||
if(this._shieldSprite.alpha == 1)
|
||||
{
|
||||
this._shieldSprite.alpha = 0.2;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._shieldSprite.alpha = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Data.control == Data.CONTROL_MOUSE)
|
||||
{
|
||||
if(x < FlxG.mouse.x)
|
||||
{
|
||||
facing = RIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
facing = LEFT;
|
||||
}
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARD)
|
||||
{
|
||||
if(FlxG.keys.LEFT)
|
||||
{
|
||||
facing = LEFT;
|
||||
}
|
||||
else if(FlxG.keys.RIGHT)
|
||||
{
|
||||
facing = RIGHT;
|
||||
}
|
||||
else if(FlxG.keys.A)
|
||||
{
|
||||
facing = LEFT;
|
||||
}
|
||||
else if(FlxG.keys.D)
|
||||
{
|
||||
facing = RIGHT;
|
||||
}
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARDI)
|
||||
{
|
||||
if(FlxG.keys.A)
|
||||
{
|
||||
facing = LEFT;
|
||||
}
|
||||
else if(FlxG.keys.D)
|
||||
{
|
||||
facing = RIGHT;
|
||||
}
|
||||
else if(FlxG.keys.LEFT)
|
||||
{
|
||||
facing = LEFT;
|
||||
}
|
||||
else if(FlxG.keys.RIGHT)
|
||||
{
|
||||
facing = RIGHT;
|
||||
}
|
||||
}
|
||||
if(this.hitTimer <= 0 && this.dashing <= 0 && this.controllable && !Data.state.xraying)
|
||||
{
|
||||
if(Data.state.controlCharacter)
|
||||
{
|
||||
if(FlxG.keys.D || FlxG.keys.RIGHT && Data.control == Data.CONTROL_MOUSE)
|
||||
{
|
||||
velocity.x = this.moveSpeed;
|
||||
}
|
||||
else if(FlxG.keys.A || FlxG.keys.LEFT && Data.control == Data.CONTROL_MOUSE)
|
||||
{
|
||||
velocity.x = -this.moveSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = 0;
|
||||
}
|
||||
if(Data.control == Data.CONTROL_MOUSE)
|
||||
{
|
||||
if(FlxG.keys.D || FlxG.keys.RIGHT)
|
||||
{
|
||||
velocity.x = this.moveSpeed;
|
||||
}
|
||||
else if(FlxG.keys.A || FlxG.keys.LEFT)
|
||||
{
|
||||
velocity.x = -this.moveSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = 0;
|
||||
}
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARD)
|
||||
{
|
||||
if(FlxG.keys.D)
|
||||
{
|
||||
velocity.x = this.moveSpeed;
|
||||
}
|
||||
else if(FlxG.keys.A)
|
||||
{
|
||||
velocity.x = -this.moveSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = 0;
|
||||
}
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARDI)
|
||||
{
|
||||
if(FlxG.keys.RIGHT)
|
||||
{
|
||||
velocity.x = this.moveSpeed;
|
||||
}
|
||||
else if(FlxG.keys.LEFT)
|
||||
{
|
||||
velocity.x = -this.moveSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
acceleration.y = 700;
|
||||
_loc1_ = [true,Data.skyboots == 1,Data.moonboots == 1];
|
||||
this.i = 0;
|
||||
while(this.i < this._jump.length)
|
||||
{
|
||||
if(_loc1_[this.i])
|
||||
{
|
||||
_loc2_ = Number(this._jump[this.i]);
|
||||
if(_loc2_ > 0)
|
||||
{
|
||||
if(this.pressedJump())
|
||||
{
|
||||
this._jumping = true;
|
||||
SoundSystem.play(Sound["JUMP" + this.i],0.6);
|
||||
}
|
||||
if(this.pressingJump() && this._jumping)
|
||||
{
|
||||
this._jump[this.i] -= FlxG.elapsed;
|
||||
if(this._jump[this.i] <= 0 || isTouching(UP))
|
||||
{
|
||||
this._jumping = false;
|
||||
}
|
||||
velocity.y = this._inWater > 0 ? -150 : -200;
|
||||
}
|
||||
else if(this._jumping)
|
||||
{
|
||||
this._jumping = false;
|
||||
_loc3_ = 1 - this._jump[this.i] / (this.JUMP_TIME[this.i] + Data.jump * 0.015);
|
||||
_loc4_ = _loc3_ * -100;
|
||||
if(_loc4_ > -50)
|
||||
{
|
||||
_loc4_ = -50;
|
||||
}
|
||||
if(velocity.y < _loc4_)
|
||||
{
|
||||
velocity.y = _loc4_;
|
||||
}
|
||||
this._jump[this.i] = 0;
|
||||
}
|
||||
else if(this._jump[this.i] != this.JUMP_TIME[this.i] + Data.jump * 0.01)
|
||||
{
|
||||
this._jump[this.i] = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
++this.i;
|
||||
}
|
||||
if(!isTouching(DOWN) && !this.pressingJump())
|
||||
{
|
||||
this._jump[0] = 0;
|
||||
}
|
||||
if(isTouching(DOWN))
|
||||
{
|
||||
this.i = 0;
|
||||
while(this.i < this._jump.length)
|
||||
{
|
||||
this._jump[this.i] = this.JUMP_TIME[this.i] + Data.jump * 0.01;
|
||||
++this.i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this.hitTimer > 0)
|
||||
{
|
||||
this.hitTimer -= FlxG.elapsed;
|
||||
}
|
||||
if(velocity.y != 0)
|
||||
{
|
||||
play("jump");
|
||||
}
|
||||
else if(velocity.x != 0)
|
||||
{
|
||||
play("walk");
|
||||
}
|
||||
else
|
||||
{
|
||||
play("stand");
|
||||
}
|
||||
if(this._inWater > 0)
|
||||
{
|
||||
--this._inWater;
|
||||
drag.x = 600;
|
||||
acceleration.y = 100;
|
||||
if(velocity.y < 0)
|
||||
{
|
||||
maxVelocity.y = 400;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxVelocity.y = 50;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
drag.x = 400;
|
||||
maxVelocity.y = 400;
|
||||
}
|
||||
--this.inHidden;
|
||||
super.update();
|
||||
if(!(Data.state is HorizontalMode))
|
||||
{
|
||||
if(x + width > FlxG.width)
|
||||
{
|
||||
x = FlxG.width - width;
|
||||
}
|
||||
}
|
||||
if(x < 0)
|
||||
{
|
||||
x = 0;
|
||||
}
|
||||
if(Data.hp > 0)
|
||||
{
|
||||
if(this.invulnerable > 0)
|
||||
{
|
||||
this.invulnerable -= FlxG.elapsed;
|
||||
alpha = 0.65;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = 1;
|
||||
}
|
||||
}
|
||||
if(getScreenXY().y > Config.HEIGHT + height)
|
||||
{
|
||||
Data.hp = 0;
|
||||
Data.state.die();
|
||||
}
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
var _loc3_:ArcSprite = null;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc6_:int = 0;
|
||||
var _loc1_:Number = x + width / 2;
|
||||
var _loc2_:Number = y + height / 2;
|
||||
if(!this.controllable || Data.state.isComplete() || Data.state.inMenu)
|
||||
{
|
||||
this.radians = facing == LEFT ? (Number(this.radians = Math.PI)) : 0;
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_MOUSE)
|
||||
{
|
||||
this.radians = Math.atan2(FlxG.mouse.y - _loc2_,FlxG.mouse.x - _loc1_);
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARD)
|
||||
{
|
||||
if(FlxG.keys.LEFT && FlxG.keys.UP)
|
||||
{
|
||||
this.radians = 5 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.LEFT && FlxG.keys.DOWN)
|
||||
{
|
||||
this.radians = 3 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.LEFT)
|
||||
{
|
||||
this.radians = 4 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.RIGHT && FlxG.keys.UP)
|
||||
{
|
||||
this.radians = 7 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.RIGHT && FlxG.keys.DOWN)
|
||||
{
|
||||
this.radians = 1 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.RIGHT)
|
||||
{
|
||||
this.radians = 0;
|
||||
}
|
||||
else if(FlxG.keys.DOWN)
|
||||
{
|
||||
this.radians = 2 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.UP)
|
||||
{
|
||||
this.radians = 6 * Math.PI / 4;
|
||||
}
|
||||
else if(facing == LEFT)
|
||||
{
|
||||
this.radians = 4 * Math.PI / 4;
|
||||
}
|
||||
else if(facing == RIGHT)
|
||||
{
|
||||
this.radians = 0;
|
||||
}
|
||||
}
|
||||
else if(Data.control == Data.CONTROL_KEYBOARDI)
|
||||
{
|
||||
if(FlxG.keys.A && FlxG.keys.W)
|
||||
{
|
||||
this.radians = 5 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.A && FlxG.keys.S)
|
||||
{
|
||||
this.radians = 3 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.A)
|
||||
{
|
||||
this.radians = 4 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.D && FlxG.keys.W)
|
||||
{
|
||||
this.radians = 7 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.D && FlxG.keys.S)
|
||||
{
|
||||
this.radians = 1 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.D)
|
||||
{
|
||||
this.radians = 0;
|
||||
}
|
||||
else if(FlxG.keys.S)
|
||||
{
|
||||
this.radians = 2 * Math.PI / 4;
|
||||
}
|
||||
else if(FlxG.keys.W)
|
||||
{
|
||||
this.radians = 6 * Math.PI / 4;
|
||||
}
|
||||
else if(facing == LEFT)
|
||||
{
|
||||
this.radians = 4 * Math.PI / 4;
|
||||
}
|
||||
else if(facing == RIGHT)
|
||||
{
|
||||
this.radians = 0;
|
||||
}
|
||||
}
|
||||
if(!Data.state.inMenu && Data.lasersight == 1 && Data.hp > 0 && this.controllable && Data.control == Data.CONTROL_MOUSE && !Data.state.isComplete())
|
||||
{
|
||||
_loc4_ = 8 * Math.cos(this.radians);
|
||||
_loc5_ = 8 * Math.sin(this.radians);
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < 50)
|
||||
{
|
||||
this.dots[_loc6_].x = x + width / 2 + _loc4_ * _loc6_;
|
||||
this.dots[_loc6_].y = y + height / 2 + _loc5_ * _loc6_;
|
||||
this.dots[_loc6_].draw();
|
||||
_loc6_++;
|
||||
}
|
||||
}
|
||||
super.draw();
|
||||
if(this.radians <= -0.4 && this.radians > -2.74 || this.radians > 3.9)
|
||||
{
|
||||
_loc3_ = this.gunUp;
|
||||
}
|
||||
else if(this.radians >= 0.4 && this.radians < 2.74)
|
||||
{
|
||||
_loc3_ = this.gunDown;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = this.gunRight;
|
||||
}
|
||||
_loc3_.x = x;
|
||||
_loc3_.y = y;
|
||||
_loc3_.frame = frame;
|
||||
_loc3_.facing = facing;
|
||||
_loc3_.alpha = alpha;
|
||||
if(Boolean(Data.prime) && this.hasGun)
|
||||
{
|
||||
_loc3_.draw();
|
||||
}
|
||||
if(this.shielded && Data.hp > 0)
|
||||
{
|
||||
this._shieldSprite.x = x - 7;
|
||||
this._shieldSprite.y = y - 7;
|
||||
this._shieldSprite.draw();
|
||||
}
|
||||
if(this.elevator != null)
|
||||
{
|
||||
this.elevator.x = getMidpoint().x - 30;
|
||||
this.elevator.y = y + height;
|
||||
this.elevator.draw();
|
||||
}
|
||||
if(Data.state.xraying)
|
||||
{
|
||||
Data.state.xray.x = x + 3;
|
||||
Data.state.xray.y = y + 6;
|
||||
Data.state.xray.angle = this.radians * 180 / Math.PI;
|
||||
}
|
||||
}
|
||||
|
||||
public function hit(param1:int, param2:Boolean = false, param3:Boolean = true, param4:Boolean = true, param5:Boolean = false) : Boolean
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
if(this.invulnerable > 0 && !param2 || Data.hp <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.lastHitLava = param5;
|
||||
if(param4)
|
||||
{
|
||||
this.hitTimer = HIT_TIME - Data.recover * 0.05;
|
||||
}
|
||||
this.invulnerable = 1 + 0.15 * Data.aegis;
|
||||
if(param3)
|
||||
{
|
||||
_loc6_ = ArcU.clamp(Math.min(1 + Math.floor(param1 / 6),param5 ? 16 : 12) - Data.defense,1,19);
|
||||
if(param1 > 50)
|
||||
{
|
||||
_loc6_ = ArcU.clamp(_loc6_ - 2,1,19);
|
||||
}
|
||||
else if(param1 > 40)
|
||||
{
|
||||
_loc6_ = ArcU.clamp(_loc6_ - 1,1,19);
|
||||
}
|
||||
Data.hp -= _loc6_;
|
||||
SoundSystem.play(Sound.HURT);
|
||||
}
|
||||
if(Data.hp <= 0)
|
||||
{
|
||||
this.kill();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
Data.hp = 0;
|
||||
Data.state.die();
|
||||
SoundSystem.play(Sound.PLAYER_DIE);
|
||||
}
|
||||
|
||||
public function get isHit() : Boolean
|
||||
{
|
||||
return this.hitTimer > 0;
|
||||
}
|
||||
|
||||
public function shield(param1:Number) : void
|
||||
{
|
||||
this._shield = Data.state is TadpoleMode ? 5 : param1;
|
||||
this._shieldSprite.alpha = 1;
|
||||
}
|
||||
|
||||
public function get shielded() : Boolean
|
||||
{
|
||||
return this._shield > 0;
|
||||
}
|
||||
|
||||
public function inWater() : void
|
||||
{
|
||||
this._inWater = 3;
|
||||
}
|
||||
|
||||
public function inLava() : void
|
||||
{
|
||||
this.hit(10);
|
||||
}
|
||||
|
||||
override public function reset(param1:Number, param2:Number) : void
|
||||
{
|
||||
super.reset(param1,param2);
|
||||
this.hitTimer = 0;
|
||||
this._shield = 0;
|
||||
this._inWater = 0;
|
||||
this.invulnerable = 0;
|
||||
alpha = 1;
|
||||
}
|
||||
|
||||
public function showElevator() : void
|
||||
{
|
||||
this.elevator = new ArcSprite(0,0,elevatorSprite);
|
||||
}
|
||||
|
||||
public function drawShield(param1:Number, param2:Number) : void
|
||||
{
|
||||
this._shieldSprite.x = param1 + 2;
|
||||
this._shieldSprite.y = param2 + 3;
|
||||
this._shieldSprite.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import com.arc.dh.state.TadpoleMode;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import com.arc.flixel.ArcU;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class PlayerTadpole extends ArcSprite
|
||||
{
|
||||
|
||||
public static const sprite:Class = PlayerTadpole_sprite;
|
||||
|
||||
private static const DY:Number = 400;
|
||||
|
||||
private static const MAXVY:Number = 100;
|
||||
|
||||
private var _dead:Boolean = false;
|
||||
|
||||
public function PlayerTadpole(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2);
|
||||
loadRotatedGraphic(sprite,60,-1,true,true);
|
||||
width = height = 2;
|
||||
offset.x = offset.y = 6;
|
||||
angle = 90;
|
||||
this.draw();
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var _loc1_:Number = NaN;
|
||||
if(!this._dead)
|
||||
{
|
||||
if(this.held())
|
||||
{
|
||||
velocity.y -= FlxG.elapsed * DY;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.y += FlxG.elapsed * DY;
|
||||
}
|
||||
velocity.y = ArcU.clamp(velocity.y,-MAXVY,MAXVY);
|
||||
_loc1_ = Math.atan2(velocity.y,MAXVY);
|
||||
angle = 180 / Math.PI * _loc1_ + 45;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = 0;
|
||||
velocity.y = 0;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
super.draw();
|
||||
if(Data.state.player.shielded)
|
||||
{
|
||||
Data.state.player.drawShield(x - 7,y - 7);
|
||||
Data.state.player.drawShield(x - 7,y - 7);
|
||||
}
|
||||
}
|
||||
|
||||
private function held() : Boolean
|
||||
{
|
||||
return FlxG.mouse.pressed() || FlxG.keys.SPACE || FlxG.keys.W || FlxG.keys.UP;
|
||||
}
|
||||
|
||||
private function get speed() : Number
|
||||
{
|
||||
return (Data.state as TadpoleMode).camera.velocity.x;
|
||||
}
|
||||
|
||||
public function die() : void
|
||||
{
|
||||
this._dead = true;
|
||||
}
|
||||
|
||||
public function isDead() : Boolean
|
||||
{
|
||||
return this._dead;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/188_com.arc.dh.entities.PlayerTadpole_sprite.png")]
|
||||
public class PlayerTadpole_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PlayerTadpole_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/106_com.arc.dh.entities.Player_dotSprite.png")]
|
||||
public class Player_dotSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_dotSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/60_com.arc.dh.entities.Player_elevatorSprite.png")]
|
||||
public class Player_elevatorSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_elevatorSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/95_com.arc.dh.entities.Player_gunDownSprite.png")]
|
||||
public class Player_gunDownSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_gunDownSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/277_com.arc.dh.entities.Player_gunRightSprite.png")]
|
||||
public class Player_gunRightSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_gunRightSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/279_com.arc.dh.entities.Player_gunUpSprite.png")]
|
||||
public class Player_gunUpSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_gunUpSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/261_com.arc.dh.entities.Player_shieldSprite.png")]
|
||||
public class Player_shieldSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_shieldSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.entities
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/243_com.arc.dh.entities.Player_sprite.png")]
|
||||
public class Player_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Player_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class CharacterPane extends MenuPane
|
||||
{
|
||||
|
||||
private static const sprite:Class = CharacterPane_sprite;
|
||||
|
||||
private static const heartMeterSprite:Class = CharacterPane_heartMeterSprite;
|
||||
|
||||
private var _diamonds:FlxBitmapText;
|
||||
|
||||
private var _skills:Array = new Array();
|
||||
|
||||
private var _guns:Array = new Array();
|
||||
|
||||
private var _heartmeter:ArcSprite = new ArcSprite();
|
||||
|
||||
public function CharacterPane()
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:Array = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:GunComponent = null;
|
||||
var _loc7_:SkillMeter = null;
|
||||
var _loc8_:Array = null;
|
||||
var _loc9_:Equipment = null;
|
||||
super(1,1,sprite);
|
||||
var _loc1_:Array = ["agility","jump","attract","recover","aegis","defense"];
|
||||
var _loc2_:int = 43;
|
||||
for each(_loc3_ in _loc1_)
|
||||
{
|
||||
_loc7_ = new SkillMeter(14,_loc2_,_loc3_);
|
||||
this.add(_loc7_);
|
||||
this._skills.push(_loc7_);
|
||||
_loc2_ += 10;
|
||||
}
|
||||
_loc4_ = [["autofirer","Autofire"],["lasersight","Laser Sight"],["skyboots","Sky Boots"],["moltensuit","Molten Suit"],["moonboots","Moon Boots"],["prime","Prime Gun"],["spreader","Spreader Gun"],["missile","Missile Gun"],["rebound","Rebound Gun"],["xrayscope","X-Ray Scope"]];
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc4_.length)
|
||||
{
|
||||
_loc8_ = _loc4_[_loc5_] as Array;
|
||||
_loc9_ = new Equipment(_loc5_,_loc8_[1] as String,_loc8_[0] as String);
|
||||
this.add(_loc9_);
|
||||
_loc5_++;
|
||||
}
|
||||
this._diamonds = new FlxBitmapText(26,195,Fonts.font(Fonts.SMALL_WHITE),Data.diamonds + " DIAMONDS","center",99);
|
||||
this.add(this._diamonds);
|
||||
this._heartmeter = new ArcSprite(33,23);
|
||||
this._heartmeter.loadGraphic(heartMeterSprite,true,false,103,7);
|
||||
this.add(this._heartmeter);
|
||||
_loc6_ = new GunComponent(150,21,"primegun","prime");
|
||||
this._guns.push(_loc6_);
|
||||
this.add(_loc6_);
|
||||
_loc6_ = new GunComponent(250,21,"spreadergun","spreader");
|
||||
this._guns.push(_loc6_);
|
||||
this.add(_loc6_);
|
||||
_loc6_ = new GunComponent(150,114,"missilegun","missile");
|
||||
this._guns.push(_loc6_);
|
||||
this.add(_loc6_);
|
||||
_loc6_ = new GunComponent(250,114,"reboundgun","rebound");
|
||||
this._guns.push(_loc6_);
|
||||
this.add(_loc6_);
|
||||
this.sync();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
public function clickTryAgain() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function clickMenu() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function sync(param1:Boolean = false) : void
|
||||
{
|
||||
var _loc2_:SkillMeter = null;
|
||||
var _loc3_:GunComponent = null;
|
||||
this._heartmeter.frame = Data.hpm;
|
||||
this._diamonds.text = Data.diamonds + " DIAMONDS";
|
||||
for each(_loc2_ in this._skills)
|
||||
{
|
||||
_loc2_.sync();
|
||||
}
|
||||
for each(_loc3_ in this._guns)
|
||||
{
|
||||
_loc3_.sync();
|
||||
}
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._heartmeter.hover())
|
||||
{
|
||||
if(Menu.tooltip == null || Menu.tooltip.source != this)
|
||||
{
|
||||
Menu.tooltip = new MenuTooltip(this._heartmeter.x + this._heartmeter.width / 2,this._heartmeter.y,"Heart Crystals Obtained",Data.vitality + " of 17");
|
||||
Menu.tooltip.source = this;
|
||||
}
|
||||
Menu.hovering = true;
|
||||
}
|
||||
super.update();
|
||||
if(FlxG.mouse.justPressed())
|
||||
{
|
||||
this.sync();
|
||||
}
|
||||
}
|
||||
|
||||
public function tooltip(param1:String, param2:String = "left") : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/104_com.arc.dh.menu.CharacterPane_heartMeterSprite.png")]
|
||||
public class CharacterPane_heartMeterSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function CharacterPane_heartMeterSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/250_com.arc.dh.menu.CharacterPane_sprite.png")]
|
||||
public class CharacterPane_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function CharacterPane_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/232_com.arc.dh.menu.CompleteWindow_sprite.png")]
|
||||
public class CompleteWindow_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function CompleteWindow_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.BossMode;
|
||||
import com.arc.dh.state.EscapeMode;
|
||||
import com.arc.dh.state.MainMenu;
|
||||
import com.arc.dh.state.StoryMode;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.DataSerializer;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class ConfirmationMenu extends ArcGroup
|
||||
{
|
||||
|
||||
private var window:Class;
|
||||
|
||||
private var quit:Class;
|
||||
|
||||
private var cancel:Class;
|
||||
|
||||
private var menu:Menu;
|
||||
|
||||
public function ConfirmationMenu(param1:Menu)
|
||||
{
|
||||
var window:ArcSprite;
|
||||
var M:Menu = param1;
|
||||
this.window = ConfirmationMenu_window;
|
||||
this.quit = ConfirmationMenu_quit;
|
||||
this.cancel = ConfirmationMenu_cancel;
|
||||
super();
|
||||
this.menu = M;
|
||||
window = new ArcSprite(71,95,this.window);
|
||||
this.add(window);
|
||||
this.add(new ArcButton(window.x + 22,window.y + 41,72,13,this.quit).selectable(false).callback(function():void
|
||||
{
|
||||
var screen:* = undefined;
|
||||
screen = 0;
|
||||
if(Data.state is StoryMode)
|
||||
{
|
||||
screen = 3;
|
||||
}
|
||||
else if(Data.state is BossMode)
|
||||
{
|
||||
screen = 2;
|
||||
}
|
||||
else if(Data.state is EscapeMode)
|
||||
{
|
||||
screen = 1;
|
||||
}
|
||||
FlxG.fade(4278190080,0.25,function():void
|
||||
{
|
||||
FlxG.mouse.hide();
|
||||
DataSerializer.save();
|
||||
FlxG.switchState(new MainMenu(screen));
|
||||
});
|
||||
}));
|
||||
this.add(new ArcButton(window.x + 123,window.y + 41,72,13,this.cancel).selectable(false).callback(function():void
|
||||
{
|
||||
menu.inConfirmation = false;
|
||||
}));
|
||||
this.add(new FlxBitmapText(window.x + 10,window.y + 13,Fonts.font(Fonts.SMALL_WHITE),"ARE YOU SURE YOU WANT TO RETURN TO THE MAIN MENU? YOU WILL LOSE ALL SAVED PROGRESS ON THIS STAGE.","center",197));
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(FlxG.keys.justPressed("ESCAPE"))
|
||||
{
|
||||
this.menu.inConfirmation = false;
|
||||
FlxG.keys.update();
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/254_com.arc.dh.menu.ConfirmationMenu_cancel.png")]
|
||||
public class ConfirmationMenu_cancel extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ConfirmationMenu_cancel()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/257_com.arc.dh.menu.ConfirmationMenu_quit.png")]
|
||||
public class ConfirmationMenu_quit extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ConfirmationMenu_quit()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/252_com.arc.dh.menu.ConfirmationMenu_window.png")]
|
||||
public class ConfirmationMenu_window extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ConfirmationMenu_window()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class Equipment extends ArcGroup
|
||||
{
|
||||
|
||||
private static const icons:Class = Equipment_icons;
|
||||
|
||||
private var _name:FlxBitmapText;
|
||||
|
||||
private var _acquired:FlxBitmapText;
|
||||
|
||||
private var _skill:String;
|
||||
|
||||
private var _sprite:ArcSprite;
|
||||
|
||||
private var _item:String;
|
||||
|
||||
public function Equipment(param1:Number, param2:String, param3:String)
|
||||
{
|
||||
var _loc4_:int = param1 / 5;
|
||||
var _loc5_:int = param1 % 5;
|
||||
super(22 + _loc5_ * 23 + (_loc5_ > 1 ? 1 : 0),127 + _loc4_ * 23);
|
||||
this._skill = param3;
|
||||
this._sprite = new ArcSprite(0,0);
|
||||
this._sprite.loadGraphic(icons,true,false,14,14);
|
||||
this._sprite.addAnimation("item",[param1]);
|
||||
this._sprite.play("item");
|
||||
this.add(this._sprite);
|
||||
this._item = param2;
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
this.sync();
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._sprite.hover())
|
||||
{
|
||||
if(Menu.tooltip == null || Menu.tooltip.source != this)
|
||||
{
|
||||
Menu.tooltip = new MenuTooltip(this._sprite.x + this._sprite.width / 2,this._sprite.y,this.getName().toUpperCase(),this.getDescription().toUpperCase());
|
||||
Menu.tooltip.source = this;
|
||||
}
|
||||
Menu.hovering = true;
|
||||
}
|
||||
this.sync();
|
||||
super.update();
|
||||
}
|
||||
|
||||
private function getDescription() : String
|
||||
{
|
||||
switch(this._item)
|
||||
{
|
||||
case "Autofire":
|
||||
return "Allows you to fire your weapon automatically. Press \'F\' to toggle.";
|
||||
case "Laser Sight":
|
||||
return "Creates a laser beam to aid in aiming.";
|
||||
case "Sky Boots":
|
||||
return "Allows you to double jump.";
|
||||
case "Molten Suit":
|
||||
return "Allows you to survive short periods in lava, taking damage over time.";
|
||||
case "Moon Boots":
|
||||
return "Allows you to triple jump.";
|
||||
case "Prime Gun":
|
||||
return "Shoots a steady stream of medium powered bullets.\nHotkey: 1";
|
||||
case "Spreader Gun":
|
||||
return "Shoots multiple spread out weak bullets.\nHotkey: 2";
|
||||
case "Missile Gun":
|
||||
return "Shoots high powered missiles that can break steel blocks and destroy spinning blades.\nHotkey: 3";
|
||||
case "Rebound Gun":
|
||||
return "Shoots medium powered bullets that bounce off\nof terrain.\nHotkey: 4";
|
||||
case "X-Ray Scope":
|
||||
return "Shines a scope to find hidden areas in the terrain. Cannot shoot or move while active.\nHotkey: SHIFT";
|
||||
default:
|
||||
return "MOTHERFUCKER";
|
||||
}
|
||||
}
|
||||
|
||||
private function getName() : String
|
||||
{
|
||||
return this._item;
|
||||
}
|
||||
|
||||
public function sync() : void
|
||||
{
|
||||
this._sprite.alpha = Data[this._skill] == 1 ? 0.9 : 0.3;
|
||||
this._sprite.alpha *= _alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/215.png")]
|
||||
public class Equipment_icons extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Equipment_icons()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.BossMode;
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class GameOver extends ArcGroup
|
||||
{
|
||||
|
||||
protected static const sprite:Class = GameOver_sprite;
|
||||
|
||||
protected static const spriteShort:Class = GameOver_spriteShort;
|
||||
|
||||
protected static const spriteComplete:Class = GameOver_spriteComplete;
|
||||
|
||||
protected static const spriteRetry:Class = GameOver_spriteRetry;
|
||||
|
||||
protected static const spriteMainMenu:Class = GameOver_spriteMainMenu;
|
||||
|
||||
private static const FADE_SPEED:Number = 4;
|
||||
|
||||
private var _window:ArcSprite;
|
||||
|
||||
private var _diamonds:ArcGroup;
|
||||
|
||||
private var _height:ArcGroup;
|
||||
|
||||
private var _time:ArcGroup;
|
||||
|
||||
private var _heart:ArcGroup;
|
||||
|
||||
private var _red:ArcGroup;
|
||||
|
||||
private var _continue:FlxBitmapText;
|
||||
|
||||
private var _complete:Boolean = false;
|
||||
|
||||
private var _fading:Boolean = false;
|
||||
|
||||
private var _buttonRetry:ArcButton;
|
||||
|
||||
private var _buttonMainMenu:ArcButton;
|
||||
|
||||
private var _tipText:FlxBitmapText;
|
||||
|
||||
private var _retryFunction:Function;
|
||||
|
||||
private var _menuFunction:Function;
|
||||
|
||||
public function GameOver(param1:String, param2:String, param3:String)
|
||||
{
|
||||
var buttonY:int;
|
||||
var message:String = null;
|
||||
var offset:int = 0;
|
||||
var diamonds:String = param1;
|
||||
var height:String = param2;
|
||||
var time:String = param3;
|
||||
this._diamonds = new ArcGroup();
|
||||
this._height = new ArcGroup();
|
||||
this._time = new ArcGroup();
|
||||
this._heart = new ArcGroup();
|
||||
this._red = new ArcGroup();
|
||||
super(71,89);
|
||||
if(diamonds == null && time == null)
|
||||
{
|
||||
this._window = new ArcSprite(0,0,spriteShort);
|
||||
}
|
||||
else if(diamonds == null)
|
||||
{
|
||||
this._window = new ArcSprite(0,0,spriteComplete);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._window = new ArcSprite(0,0,sprite);
|
||||
}
|
||||
this.add(this._window);
|
||||
if(diamonds != null && time != null)
|
||||
{
|
||||
this.addGroup(this._diamonds,21,26,60,"Diamonds",diamonds);
|
||||
this.addGroup(this._height,92,26,56,Data.state is HorizontalMode ? "Distance" : "Height",height);
|
||||
this.addGroup(this._time,148,26,72,"Total Time",time);
|
||||
}
|
||||
else if(time != null)
|
||||
{
|
||||
message = !(Data.state as BossMode).isPractice() ? "You have successfully completed " + ((Data.state as BossMode).isHeroic() ? "Heroic" : "Normal") + " Boss Mode!\nTime: " + time : "You\'ve successfully defeated a practice mode boss!";
|
||||
this._tipText = new FlxBitmapText(0,33,Fonts.font(Fonts.SMALL_WHITE),message.toUpperCase(),"center",218);
|
||||
this._tipText.y += (30 - this._tipText.height) / 2;
|
||||
this.add(this._tipText);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._tipText = new FlxBitmapText(0,23,Fonts.font(Fonts.SMALL_WHITE),Tip.random(),"center",218);
|
||||
offset = (30 - this._tipText.height) / 2;
|
||||
this._tipText.y += offset;
|
||||
this.add(this._tipText);
|
||||
}
|
||||
buttonY = diamonds == null && time == null ? 57 : (diamonds == null ? 64 : 50);
|
||||
this._buttonRetry = new ArcButton(22,buttonY,72,13,spriteRetry).callback(function():void
|
||||
{
|
||||
if(_complete && !_fading)
|
||||
{
|
||||
FlxG.camera.fade(4278190080,0.5,function():void
|
||||
{
|
||||
_retryFunction();
|
||||
});
|
||||
}
|
||||
}).selectable(false);
|
||||
this.add(this._buttonRetry);
|
||||
this._buttonMainMenu = new ArcButton(123,buttonY,72,13,spriteMainMenu).callback(function():void
|
||||
{
|
||||
if(_complete && !_fading)
|
||||
{
|
||||
FlxG.camera.fade(4278190080,0.5,function():void
|
||||
{
|
||||
_menuFunction();
|
||||
});
|
||||
}
|
||||
}).selectable(false);
|
||||
this.add(this._buttonMainMenu);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
alpha = 0;
|
||||
}
|
||||
|
||||
public function setCallback(param1:Function, param2:Function) : GameOver
|
||||
{
|
||||
this._retryFunction = param1;
|
||||
this._menuFunction = param2;
|
||||
return this;
|
||||
}
|
||||
|
||||
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._height,this._time,this._tipText];
|
||||
for each(o in order)
|
||||
{
|
||||
if(o != null)
|
||||
{
|
||||
if(o.alpha < 1)
|
||||
{
|
||||
o.alpha += FADE_SPEED * FlxG.elapsed;
|
||||
if(o.alpha > 1)
|
||||
{
|
||||
o.alpha = 1;
|
||||
}
|
||||
if(o == this._window)
|
||||
{
|
||||
this._buttonRetry.alpha = this._buttonMainMenu.alpha = o.alpha;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._complete = true;
|
||||
}
|
||||
else if(FlxG.keys.justPressed("R"))
|
||||
{
|
||||
FlxG.camera.fade(4278190080,0.5,function():void
|
||||
{
|
||||
_retryFunction();
|
||||
});
|
||||
}
|
||||
else if(FlxG.keys.justPressed("M"))
|
||||
{
|
||||
FlxG.camera.fade(4278190080,0.5,function():void
|
||||
{
|
||||
_menuFunction();
|
||||
});
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/115_com.arc.dh.menu.GameOver_sprite.png")]
|
||||
public class GameOver_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GameOver_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/154_com.arc.dh.menu.GameOver_spriteComplete.png")]
|
||||
public class GameOver_spriteComplete extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GameOver_spriteComplete()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/44_com.arc.dh.menu.GameOver_spriteMainMenu.png")]
|
||||
public class GameOver_spriteMainMenu extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GameOver_spriteMainMenu()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/242_com.arc.dh.menu.GameOver_spriteRetry.png")]
|
||||
public class GameOver_spriteRetry extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GameOver_spriteRetry()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/276_com.arc.dh.menu.GameOver_spriteShort.png")]
|
||||
public class GameOver_spriteShort extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GameOver_spriteShort()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
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.FlxPoint;
|
||||
|
||||
public class GunComponent extends ArcGroup
|
||||
{
|
||||
|
||||
private static const sprite:Class = GunComponent_sprite;
|
||||
|
||||
private static const COSTS:Array = [25,40,75,125,200,300,450,700,1000,1500,-1];
|
||||
|
||||
private var _bg:ArcSprite;
|
||||
|
||||
private var _skill:String;
|
||||
|
||||
private var _barPower:GunComponentBar;
|
||||
|
||||
private var _barSpeed:GunComponentBar;
|
||||
|
||||
private var _barSpecial:GunComponentBar;
|
||||
|
||||
private var _barSpecial2:GunComponentBar;
|
||||
|
||||
private var _name:FlxBitmapText;
|
||||
|
||||
private var _frame:int = 0;
|
||||
|
||||
private var _obtained:Boolean;
|
||||
|
||||
private var _obtainedSkill:String;
|
||||
|
||||
public function GunComponent(param1:Number, param2:Number, param3:String, param4:String)
|
||||
{
|
||||
var _loc5_:String = null;
|
||||
super(param1,param2);
|
||||
this._skill = param3;
|
||||
this._obtainedSkill = param4;
|
||||
this._bg = new ArcSprite(-1,0);
|
||||
this._bg.loadGraphic(sprite,true,false,97,90);
|
||||
this.add(this._bg);
|
||||
this._obtained = Data[param4] == 1;
|
||||
this._bg.frame = this._frame = this._obtained ? 0 : 1;
|
||||
switch(param3)
|
||||
{
|
||||
case "primegun":
|
||||
_loc5_ = "Prime Gun";
|
||||
break;
|
||||
case "spreadergun":
|
||||
_loc5_ = "Spreader Gun";
|
||||
break;
|
||||
case "missilegun":
|
||||
_loc5_ = "Missile Gun";
|
||||
break;
|
||||
case "reboundgun":
|
||||
_loc5_ = "Rebound Gun";
|
||||
}
|
||||
if(!this._obtained)
|
||||
{
|
||||
_loc5_ = "Unknown";
|
||||
}
|
||||
this._name = new FlxBitmapText(3,4,Fonts.font(this._obtained ? Fonts.BEVEL_BLUE : Fonts.BEVEL_GRAY),_loc5_.toUpperCase(),"center",89,true);
|
||||
this.add(this._name);
|
||||
this._barPower = new GunComponentBar(6,12,param3,0,"Main Gun",this._obtained);
|
||||
this.add(this._barPower);
|
||||
this._barSpeed = new GunComponentBar(6,29,param3,1,"Main Gun",this._obtained);
|
||||
this.add(this._barSpeed);
|
||||
this._barSpecial = new GunComponentBar(6,47,param3,2,"Main Gun",this._obtained);
|
||||
this.add(this._barSpecial);
|
||||
this._barSpecial2 = new GunComponentBar(6,65,param3,3,"Main Gun",this._obtained);
|
||||
this.add(this._barSpecial2);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
this.sync();
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
this._bg.frame = this._frame == 0 && this._bg.hover() ? 2 : uint(this._frame);
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function sync() : void
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc1_:Boolean = Data[this._obtainedSkill] == 1;
|
||||
if(_loc1_ != this._obtained)
|
||||
{
|
||||
this._obtained = _loc1_;
|
||||
switch(this._skill)
|
||||
{
|
||||
case "primegun":
|
||||
_loc2_ = "Prime Gun";
|
||||
break;
|
||||
case "spreadergun":
|
||||
_loc2_ = "Spreader Gun";
|
||||
break;
|
||||
case "missilegun":
|
||||
_loc2_ = "Missile Gun";
|
||||
break;
|
||||
case "reboundgun":
|
||||
_loc2_ = "Rebound Gun";
|
||||
}
|
||||
this.remove(this._name);
|
||||
this._name = new FlxBitmapText(3,4,Fonts.font(Fonts.BEVEL_BLUE),_loc2_.toUpperCase(),"center",89,true);
|
||||
this._name.scrollFactor = new FlxPoint(0,0);
|
||||
this.add(this._name);
|
||||
this._bg.frame = this._frame = 0;
|
||||
this._barPower.motherfuckingSync();
|
||||
this._barSpeed.motherfuckingSync();
|
||||
this._barSpecial.motherfuckingSync();
|
||||
this._barSpecial2.motherfuckingSync();
|
||||
}
|
||||
this._barPower.sync();
|
||||
this._barSpeed.sync();
|
||||
this._barSpecial.sync();
|
||||
this._barSpecial2.sync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,308 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.Gun;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.DataSerializer;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class GunComponentBar extends ArcGroup
|
||||
{
|
||||
|
||||
private static const diamondsSprite:Class = GunComponentBar_diamondsSprite;
|
||||
|
||||
private static const bgSprite:Class = GunComponentBar_bgSprite;
|
||||
|
||||
private static const barSprite:Class = GunComponentBar_barSprite;
|
||||
|
||||
private static const singleBarSprite:Class = GunComponentBar_singleBarSprite;
|
||||
|
||||
private static const barSpriteUnobtained:Class = GunComponentBar_barSpriteUnobtained;
|
||||
|
||||
private static const singleBarSpriteUnobtained:Class = GunComponentBar_singleBarSpriteUnobtained;
|
||||
|
||||
private static const COSTS:Array = [100,150,200,300,450,600,800,1000,1200,1500];
|
||||
|
||||
private static const SPECIAL_COST:int = 2500;
|
||||
|
||||
private var _bg:ArcSprite;
|
||||
|
||||
private var _bar:ArcSprite;
|
||||
|
||||
private var _skill:String;
|
||||
|
||||
private var _offset:int;
|
||||
|
||||
private var _type:int;
|
||||
|
||||
private var _name:FlxBitmapText;
|
||||
|
||||
private var _diamond:ArcSprite;
|
||||
|
||||
private var _cost:FlxBitmapText;
|
||||
|
||||
private var _obtained:Boolean;
|
||||
|
||||
public function GunComponentBar(param1:Number, param2:Number, param3:String, param4:int, param5:String, param6:Boolean)
|
||||
{
|
||||
super(param1,param2);
|
||||
this._skill = param3;
|
||||
this._offset = param4;
|
||||
this._type = param4 >= 2 ? 1 : 10;
|
||||
this._obtained = param6;
|
||||
this._bg = new ArcSprite(-1,3);
|
||||
this.add(this._bg);
|
||||
this._bar = new ArcSprite(0,10);
|
||||
if(this._type == 1)
|
||||
{
|
||||
this._bar.loadGraphic(param6 ? singleBarSprite : singleBarSpriteUnobtained,true,false,83,7);
|
||||
}
|
||||
else if(this._type == 10)
|
||||
{
|
||||
this._bar.loadGraphic(param6 ? barSprite : barSpriteUnobtained,true,false,83,7);
|
||||
}
|
||||
this._bg.loadGraphic(bgSprite,false,false,85,15);
|
||||
this._bar.frame = Data[this._skill][this._offset];
|
||||
this.add(this._bar);
|
||||
this._diamond = new ArcSprite(this._bar.width - 8,3);
|
||||
this._diamond.loadGraphic(diamondsSprite,true,false,8,8);
|
||||
this._diamond.frame = param6 ? 1 : 5;
|
||||
this._diamond.alpha = param6 ? 1 : 0.5;
|
||||
this.add(this._diamond);
|
||||
this._cost = new FlxBitmapText(this._diamond.x - 48,4,Fonts.font(Fonts.OUTLINE_BLUE_S),"","right",40,true);
|
||||
this.add(this._cost);
|
||||
var _loc7_:String = param6 ? this.getName(param3,param4) : "Unknown";
|
||||
this._name = new FlxBitmapText(0,4,Fonts.font(param6 ? Fonts.OUTLINE_BLUE_S : Fonts.OUTLINE_BLACK_S),_loc7_.toUpperCase(),"left",100,true);
|
||||
if(!param6)
|
||||
{
|
||||
this._name.alpha = 0.5;
|
||||
}
|
||||
this.add(this._name);
|
||||
this.sync();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
public function sync() : void
|
||||
{
|
||||
var _loc1_:int = this.getCost(this._skill,this._offset);
|
||||
this._bar.frame = Data[this._skill][this._offset];
|
||||
if(this._obtained)
|
||||
{
|
||||
this._cost.text = _loc1_ == -1 ? "" : _loc1_.toString();
|
||||
}
|
||||
this._diamond.frame = !this._obtained ? 5 : (_loc1_ == -1 ? 4 : (_loc1_ > Data.diamonds ? 3 : 1));
|
||||
}
|
||||
|
||||
public function motherfuckingSync() : void
|
||||
{
|
||||
if(this._type == 1)
|
||||
{
|
||||
this._bar.loadGraphic(singleBarSprite,true,false,83,7);
|
||||
}
|
||||
else if(this._type == 10)
|
||||
{
|
||||
this._bar.loadGraphic(barSprite,true,false,83,7);
|
||||
}
|
||||
this._obtained = true;
|
||||
this._bar.frame = Data[this._skill][this._offset];
|
||||
this._name.font = Fonts.font(Fonts.OUTLINE_BLUE_S);
|
||||
this._name.text = this.getName(this._skill,this._offset);
|
||||
this._name.alpha = 1;
|
||||
this.sync();
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var _loc1_:String = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc4_:String = null;
|
||||
var _loc5_:Array = null;
|
||||
if(this._bg.hover())
|
||||
{
|
||||
this._bg.alpha = 0.4;
|
||||
if(FlxG.mouse.justPressed() && this._obtained)
|
||||
{
|
||||
if(Data[this._skill][this._offset] < this._type && Data.diamonds >= this.getCost(this._skill,this._offset))
|
||||
{
|
||||
SoundSystem.play(Sound.BUY);
|
||||
Data.diamonds -= this.getCost(this._skill,this._offset);
|
||||
++Data[this._skill][this._offset];
|
||||
AchievementSystem.guns();
|
||||
this.sync();
|
||||
DataSerializer.save();
|
||||
Menu.tooltip = null;
|
||||
}
|
||||
}
|
||||
if((Menu.tooltip == null || Menu.tooltip.source != this) && this._obtained)
|
||||
{
|
||||
_loc1_ = null;
|
||||
_loc2_ = 0;
|
||||
_loc3_ = 0;
|
||||
_loc4_ = this._skill.replace("gun","").toUpperCase();
|
||||
if(this._offset == 0)
|
||||
{
|
||||
_loc1_ = "DAMAGE";
|
||||
switch(this._skill)
|
||||
{
|
||||
case "primegun":
|
||||
_loc5_ = Gun.PRIME_DAMAGE;
|
||||
break;
|
||||
case "spreadergun":
|
||||
_loc5_ = Gun.SPREADER_DAMAGE;
|
||||
break;
|
||||
case "missilegun":
|
||||
_loc5_ = Gun.MISSILE_DAMAGE;
|
||||
break;
|
||||
case "reboundgun":
|
||||
_loc5_ = Gun.REBOUND_DAMAGE;
|
||||
}
|
||||
}
|
||||
else if(this._offset == 1)
|
||||
{
|
||||
_loc1_ = "DELAY";
|
||||
switch(this._skill)
|
||||
{
|
||||
case "primegun":
|
||||
_loc5_ = Gun.PRIME_DELAY;
|
||||
break;
|
||||
case "spreadergun":
|
||||
_loc5_ = Gun.SPREADER_DELAY;
|
||||
break;
|
||||
case "missilegun":
|
||||
_loc5_ = Gun.MISSILE_DELAY;
|
||||
break;
|
||||
case "reboundgun":
|
||||
_loc5_ = Gun.REBOUND_DELAY;
|
||||
}
|
||||
}
|
||||
if(_loc1_ != null)
|
||||
{
|
||||
_loc2_ = Number(_loc5_[Data[this._skill][this._offset]]);
|
||||
_loc3_ = Data[this._skill][this._offset] < 10 ? Number(_loc5_[Data[this._skill][this._offset] + 1]) : Number(null);
|
||||
}
|
||||
Menu.tooltip = new MenuTooltip(this._bg.x + this._bg.width / 2,this._bg.y,this.getName(this._skill,this._offset),this.getDescription(this._skill,this._offset),_loc1_,_loc2_,_loc3_);
|
||||
Menu.tooltip.source = this;
|
||||
}
|
||||
Menu.hovering = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._bg.alpha = 0.17;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
private function getCost(param1:String, param2:int) : int
|
||||
{
|
||||
var _loc3_:int = int(Data[param1][param2]);
|
||||
if(param2 == 0)
|
||||
{
|
||||
return _loc3_ == 10 ? -1 : int(COSTS[_loc3_]);
|
||||
}
|
||||
if(param2 == 1)
|
||||
{
|
||||
return _loc3_ == 10 ? -1 : int(COSTS[_loc3_]);
|
||||
}
|
||||
if(param2 == 2)
|
||||
{
|
||||
return _loc3_ == 1 ? -1 : SPECIAL_COST;
|
||||
}
|
||||
if(param2 == 3)
|
||||
{
|
||||
return _loc3_ == 1 ? -1 : SPECIAL_COST;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private function getDescription(param1:String, param2:int) : String
|
||||
{
|
||||
if(param2 == 0)
|
||||
{
|
||||
return "Increases damage done";
|
||||
}
|
||||
if(param2 == 1)
|
||||
{
|
||||
return "Increases firing rate";
|
||||
}
|
||||
if(param2 == 2)
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case "primegun":
|
||||
return "Adds a 30% chance of double damage";
|
||||
case "spreadergun":
|
||||
return "Shoots 5 bullets instead of 3";
|
||||
case "missilegun":
|
||||
return "Missiles obsorb enemy projectiles";
|
||||
case "reboundgun":
|
||||
return "Rebound bullets bounce three times";
|
||||
}
|
||||
}
|
||||
else if(param2 == 3)
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case "primegun":
|
||||
return "Shoots 2 bullets side by side";
|
||||
case "spreadergun":
|
||||
return "Doubles the damage of your center spreader bullet";
|
||||
case "missilegun":
|
||||
return "Missiles explode into 6 bullets on contact";
|
||||
case "reboundgun":
|
||||
return "Rebound bullets bounce off enemies";
|
||||
}
|
||||
}
|
||||
return "SHIT";
|
||||
}
|
||||
|
||||
private function getName(param1:String, param2:int) : String
|
||||
{
|
||||
if(param2 == 0)
|
||||
{
|
||||
return "POWER";
|
||||
}
|
||||
if(param2 == 1)
|
||||
{
|
||||
return "SPEED";
|
||||
}
|
||||
if(param2 == 2)
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case "primegun":
|
||||
return "CRITICAL";
|
||||
case "spreadergun":
|
||||
return "SPREAD";
|
||||
case "missilegun":
|
||||
return "ABSORB";
|
||||
case "reboundgun":
|
||||
return "TRIPLE";
|
||||
}
|
||||
}
|
||||
else if(param2 == 3)
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case "primegun":
|
||||
return "TWIN";
|
||||
case "spreadergun":
|
||||
return "FOCUS";
|
||||
case "missilegun":
|
||||
return "SHRAPNEL";
|
||||
case "reboundgun":
|
||||
return "ENEMY";
|
||||
}
|
||||
}
|
||||
return "FUCK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/297_com.arc.dh.menu.GunComponentBar_barSprite.png")]
|
||||
public class GunComponentBar_barSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_barSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/80_com.arc.dh.menu.GunComponentBar_barSpriteUnobtained.png")]
|
||||
public class GunComponentBar_barSpriteUnobtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_barSpriteUnobtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/75_com.arc.dh.menu.GunComponentBar_bgSprite.png")]
|
||||
public class GunComponentBar_bgSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_bgSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/146.png")]
|
||||
public class GunComponentBar_diamondsSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_diamondsSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/226_com.arc.dh.menu.GunComponentBar_singleBarSprite.png")]
|
||||
public class GunComponentBar_singleBarSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_singleBarSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/136_com.arc.dh.menu.GunComponentBar_singleBarSpriteUnobtained.png")]
|
||||
public class GunComponentBar_singleBarSpriteUnobtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponentBar_singleBarSpriteUnobtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/90_com.arc.dh.menu.GunComponent_sprite.png")]
|
||||
public class GunComponent_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function GunComponent_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.Tooltip;
|
||||
import com.arc.dh.state.UI;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.DataSerializer;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcButtonGroup;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class Menu extends ArcGroup
|
||||
{
|
||||
|
||||
public static var tooltip:Tooltip;
|
||||
|
||||
public static const optionsButton:Class = Menu_optionsButton;
|
||||
|
||||
public static const backButton:Class = Menu_backButton;
|
||||
|
||||
public static const closeButton:Class = Menu_closeButton;
|
||||
|
||||
private static const FADE_SPEED:int = 7;
|
||||
|
||||
public static var hovering:Boolean = false;
|
||||
|
||||
private var spriteCharacterButton:Class;
|
||||
|
||||
private var spriteStatisticsButton:Class;
|
||||
|
||||
private var _pane:MenuPane;
|
||||
|
||||
private var _paneCharacter:MenuPane;
|
||||
|
||||
private var _paneStatistics:MenuPane;
|
||||
|
||||
private var _paneMessageLog:MenuPane;
|
||||
|
||||
private var _buttons:ArcButtonGroup;
|
||||
|
||||
private var _open:Boolean = false;
|
||||
|
||||
private var _fading:Boolean = false;
|
||||
|
||||
private var _characterButton:ArcButton;
|
||||
|
||||
private var _statisticsButton:ArcButton;
|
||||
|
||||
private var _closeButton:ArcButton;
|
||||
|
||||
private var _backButton:ArcButton;
|
||||
|
||||
private var _optionsButton:ArcButton;
|
||||
|
||||
public var options:OptionsMenu;
|
||||
|
||||
public var inOptions:Boolean = false;
|
||||
|
||||
public var confirmation:ConfirmationMenu;
|
||||
|
||||
public var inConfirmation:Boolean = false;
|
||||
|
||||
public function Menu()
|
||||
{
|
||||
var pane:MenuPane = null;
|
||||
this.spriteCharacterButton = Menu_spriteCharacterButton;
|
||||
this.spriteStatisticsButton = Menu_spriteStatisticsButton;
|
||||
this._paneCharacter = new CharacterPane();
|
||||
this._paneStatistics = new StatisticsPane();
|
||||
this._paneMessageLog = new MessageLogPane();
|
||||
this._buttons = new ArcButtonGroup();
|
||||
super();
|
||||
this._pane = this._paneCharacter;
|
||||
for each(pane in [this._paneCharacter,this._paneStatistics])
|
||||
{
|
||||
pane.update();
|
||||
}
|
||||
add(this._buttons);
|
||||
this._buttons.addButton(this._characterButton = new ArcButton(52,219,128,17,this.spriteCharacterButton).callback(function():void
|
||||
{
|
||||
_pane = _paneCharacter;
|
||||
_pane.sync();
|
||||
}).select());
|
||||
this._buttons.addButton(this._statisticsButton = new ArcButton(52 + 127,219,128,17,this.spriteStatisticsButton).callback(function():void
|
||||
{
|
||||
_pane = _paneStatistics;
|
||||
_pane.sync();
|
||||
}));
|
||||
this._optionsButton = new ArcButton(313,204,34,29,optionsButton).selectable(false).callback(function():void
|
||||
{
|
||||
inOptions = true;
|
||||
});
|
||||
this.add(this._optionsButton);
|
||||
this.options = new OptionsMenu(function():void
|
||||
{
|
||||
inOptions = false;
|
||||
});
|
||||
this._backButton = new ArcButton(13,207,33,23,backButton).selectable(false).callback(function():void
|
||||
{
|
||||
toMenu();
|
||||
});
|
||||
this.add(this._backButton);
|
||||
this._closeButton = new ArcButton(318,5,32,11,closeButton).selectable(false).callback(function():void
|
||||
{
|
||||
Data.state.toggleMenu();
|
||||
});
|
||||
this.add(this._closeButton);
|
||||
this.confirmation = new ConfirmationMenu(this);
|
||||
this.setAlpha(false);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
alpha = 0;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var _loc1_:Array = null;
|
||||
var _loc2_:Array = null;
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:ArcButton = null;
|
||||
var _loc5_:Array = null;
|
||||
if(this.inOptions)
|
||||
{
|
||||
if(FlxG.keys.justPressed("ESCAPE"))
|
||||
{
|
||||
FlxG.keys.update();
|
||||
this.inOptions = false;
|
||||
DataSerializer.save();
|
||||
}
|
||||
this.options.update();
|
||||
_loc1_ = [this.options.mouse,this.options.kb1,this.options.kb2,this.options.reset];
|
||||
_loc2_ = [["Mouse Controls","Use A/D or LEFT/RIGHT to move, W or SPACE or UP to jump, MOUSE to aim, MOUSE BUTTON to shoot."],["Keyboard Controls","Use A/D to move, W or SPACE to jump, ARROWS to aim and shoot."],["Inverse Keyboard","Use LEFT/RIGHT to move, UP or SPACE to jump, A/S/D/W to aim and shoot."],["Reset All Data","This will clear all your saved data and restart you from scratch. Hold shift and click this button to clear data."]];
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc1_.length)
|
||||
{
|
||||
_loc4_ = _loc1_[_loc3_] as ArcButton;
|
||||
_loc5_ = _loc2_[_loc3_] as Array;
|
||||
if(_loc4_.hover())
|
||||
{
|
||||
if(tooltip == null || tooltip.source != _loc4_)
|
||||
{
|
||||
tooltip = new MenuTooltip(_loc4_.x + _loc4_.width / 2,_loc4_.y,_loc5_[0],_loc5_[1]);
|
||||
tooltip.source = _loc4_;
|
||||
}
|
||||
hovering = true;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
if(!hovering && tooltip != null)
|
||||
{
|
||||
tooltip = null;
|
||||
}
|
||||
hovering = false;
|
||||
return;
|
||||
}
|
||||
if(this.inConfirmation)
|
||||
{
|
||||
this.confirmation.update();
|
||||
return;
|
||||
}
|
||||
if(this._fading)
|
||||
{
|
||||
if(this._open)
|
||||
{
|
||||
_alpha += FlxG.elapsed * FADE_SPEED;
|
||||
if(_alpha >= 1)
|
||||
{
|
||||
_alpha = 1;
|
||||
this._fading = false;
|
||||
Data.state.setMenu(this._open);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_alpha -= FlxG.elapsed * FADE_SPEED;
|
||||
if(_alpha <= 0)
|
||||
{
|
||||
_alpha = 0;
|
||||
this._fading = false;
|
||||
Data.state.setMenu(this._open);
|
||||
}
|
||||
}
|
||||
this.setAlpha();
|
||||
}
|
||||
if(this._pane == this._paneMessageLog)
|
||||
{
|
||||
this._statisticsButton.visible = this._characterButton.visible = this._optionsButton.visible = this._backButton.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._statisticsButton.visible = this._characterButton.visible = this._optionsButton.visible = this._backButton.visible = true;
|
||||
}
|
||||
this._pane.update();
|
||||
super.update();
|
||||
if(!hovering && tooltip != null)
|
||||
{
|
||||
tooltip = null;
|
||||
}
|
||||
hovering = false;
|
||||
}
|
||||
|
||||
public function toMenu() : void
|
||||
{
|
||||
this.inConfirmation = true;
|
||||
}
|
||||
|
||||
public function sync(param1:Boolean = false) : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
this._pane.draw();
|
||||
super.draw();
|
||||
if(this.inOptions)
|
||||
{
|
||||
this.options.draw();
|
||||
if(tooltip != null)
|
||||
{
|
||||
tooltip.draw();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(this.inConfirmation)
|
||||
{
|
||||
this.confirmation.draw();
|
||||
return;
|
||||
}
|
||||
if(tooltip != null)
|
||||
{
|
||||
tooltip.draw();
|
||||
}
|
||||
}
|
||||
|
||||
public function fade(param1:Boolean, param2:int = 0) : void
|
||||
{
|
||||
this._fading = true;
|
||||
this._open = param1;
|
||||
if(param1)
|
||||
{
|
||||
if(param2 == 1)
|
||||
{
|
||||
this._characterButton.select(true,true);
|
||||
this.setAlpha();
|
||||
this._paneStatistics.alpha = 1;
|
||||
this._paneStatistics.sync();
|
||||
}
|
||||
else if(param2 == 2)
|
||||
{
|
||||
this._statisticsButton.select(true,true);
|
||||
this.setAlpha();
|
||||
this._paneCharacter.alpha = 1;
|
||||
this._paneCharacter.sync();
|
||||
}
|
||||
else if(param2 == 3)
|
||||
{
|
||||
this._pane = this._paneMessageLog;
|
||||
this._pane.sync();
|
||||
this.setAlpha();
|
||||
}
|
||||
else if(this._pane == this._paneMessageLog)
|
||||
{
|
||||
this._characterButton.select(true,true);
|
||||
this.setAlpha();
|
||||
this._paneStatistics.alpha = 1;
|
||||
this._paneStatistics.sync();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._pane.sync();
|
||||
}
|
||||
Data.state.setMenu(this._open);
|
||||
}
|
||||
}
|
||||
|
||||
private function setAlpha(param1:Boolean = true) : void
|
||||
{
|
||||
alpha = _alpha;
|
||||
this._pane.alpha = _alpha;
|
||||
var _loc2_:UI = Data.state.ui;
|
||||
if(_loc2_ != null && param1)
|
||||
{
|
||||
Data.state.ui.alpha = 1 - _alpha;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAlpha() : Number
|
||||
{
|
||||
return _alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class MenuPane extends ArcGroup
|
||||
{
|
||||
|
||||
private var background:ArcSprite;
|
||||
|
||||
public function MenuPane(param1:Number, param2:Number, param3:Class)
|
||||
{
|
||||
super();
|
||||
this.background = new ArcSprite(param1,param2,param3);
|
||||
this.add(this.background);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
public function sync(param1:Boolean = false) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.Tooltip;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class MenuTooltip extends Tooltip
|
||||
{
|
||||
|
||||
private static const spriteTooltipArrow:Class = MenuTooltip_spriteTooltipArrow;
|
||||
|
||||
private static const TOOLTIP_WIDTH:int = 120;
|
||||
|
||||
private static const TOOLTIP_TEXT_WIDTH:int = 112;
|
||||
|
||||
private static const MINIMUM_HEIGHT:int = 5;
|
||||
|
||||
public var bsource:ArcButton = null;
|
||||
|
||||
private var _contents:ArcGroup = new ArcGroup();
|
||||
|
||||
public function MenuTooltip(param1:Number, param2:Number, param3:String, param4:String, param5:String = null, param6:Number = -1, param7:Number = -1)
|
||||
{
|
||||
var _loc10_:FlxBitmapText = null;
|
||||
var _loc14_:ArcSprite = null;
|
||||
var _loc8_:int = param1 - TOOLTIP_WIDTH / 2;
|
||||
if(_loc8_ < 10)
|
||||
{
|
||||
_loc8_ = 10;
|
||||
}
|
||||
else if(_loc8_ + TOOLTIP_WIDTH > FlxG.width - 10)
|
||||
{
|
||||
_loc8_ = FlxG.width - TOOLTIP_WIDTH - 10;
|
||||
}
|
||||
super(_loc8_,param2);
|
||||
var _loc9_:int = 5;
|
||||
_loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT),param3.toUpperCase(),"center",TOOLTIP_TEXT_WIDTH);
|
||||
this._contents.add(_loc10_);
|
||||
_loc9_ += _loc10_.height + 1;
|
||||
_loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_BLACK),param4.toUpperCase(),"center",TOOLTIP_TEXT_WIDTH);
|
||||
this._contents.add(_loc10_);
|
||||
_loc9_ += _loc10_.height + 2;
|
||||
if(param5 != null)
|
||||
{
|
||||
_loc14_ = new ArcSprite(6,_loc9_);
|
||||
_loc14_.makeGraphic(TOOLTIP_TEXT_WIDTH - 2,1,2868903935);
|
||||
this._contents.add(_loc14_);
|
||||
_loc9_ += 3;
|
||||
_loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"CURRENT " + param5 + ": " + param6 + (param5 == "DELAY" ? " SEC" : ""),"center",TOOLTIP_TEXT_WIDTH);
|
||||
this._contents.add(_loc10_);
|
||||
_loc9_ += _loc10_.height + 2;
|
||||
if(param7 > 0)
|
||||
{
|
||||
_loc10_ = new FlxBitmapText(4,_loc9_,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"NEXT " + param5 + ": " + param7 + (param5 == "DELAY" ? " SEC" : ""),"center",TOOLTIP_TEXT_WIDTH);
|
||||
this._contents.add(_loc10_);
|
||||
_loc9_ += _loc10_.height + 2;
|
||||
}
|
||||
}
|
||||
var _loc11_:int = _loc9_ + 2;
|
||||
var _loc12_:int = param1 - _loc8_ - 8;
|
||||
var _loc13_:ArcSprite = new ArcSprite(_loc12_,_loc11_ - 2);
|
||||
_loc13_.loadGraphic(spriteTooltipArrow,false,true,17,10);
|
||||
this._contents.add(_loc13_);
|
||||
createBackground(TOOLTIP_WIDTH,_loc11_);
|
||||
this.add(this._contents);
|
||||
this._contents.setAll("scrollFactor",new FlxPoint(0,0));
|
||||
if(param2 - _loc11_ - 5 < MINIMUM_HEIGHT)
|
||||
{
|
||||
shift(this._contents,0,24);
|
||||
shift(_background,0,24);
|
||||
_loc13_.y -= _loc11_ + 6;
|
||||
_loc13_.scale.y = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift(this._contents,0,-_loc11_ - 5);
|
||||
shift(_background,0,-_loc11_ - 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/68.png")]
|
||||
public class MenuTooltip_spriteTooltipArrow extends BitmapAsset
|
||||
{
|
||||
|
||||
public function MenuTooltip_spriteTooltipArrow()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/241_com.arc.dh.menu.Menu_backButton.png")]
|
||||
public class Menu_backButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Menu_backButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/264_com.arc.dh.menu.Menu_closeButton.png")]
|
||||
public class Menu_closeButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Menu_closeButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/84.png")]
|
||||
public class Menu_optionsButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Menu_optionsButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/144_com.arc.dh.menu.Menu_spriteCharacterButton.png")]
|
||||
public class Menu_spriteCharacterButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Menu_spriteCharacterButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/303_com.arc.dh.menu.Menu_spriteStatisticsButton.png")]
|
||||
public class Menu_spriteStatisticsButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Menu_spriteStatisticsButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.dh.util.text.Avatar;
|
||||
import com.arc.dh.util.text.TextSystem;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class MessageLogPane extends MenuPane
|
||||
{
|
||||
|
||||
private static const sprite:Class = MessageLogPane_sprite;
|
||||
|
||||
private var _messages:ArcGroup = new ArcGroup();
|
||||
|
||||
public function MessageLogPane()
|
||||
{
|
||||
super(1,1,sprite);
|
||||
this.sync();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function sync(param1:Boolean = false) : void
|
||||
{
|
||||
var _loc5_:FlxBitmapText = null;
|
||||
var _loc6_:ArcSprite = null;
|
||||
var _loc2_:Array = TextSystem.instance.recent;
|
||||
this._messages = new ArcGroup();
|
||||
var _loc3_:int = 24;
|
||||
var _loc4_:* = int(_loc2_.length - 1);
|
||||
while(_loc4_ > -1)
|
||||
{
|
||||
_loc5_ = new FlxBitmapText(36,_loc3_,Fonts.font(Fonts.OUTLINE_BLACK),_loc2_[_loc4_][1].toUpperCase(),"left",308,true);
|
||||
if(_loc2_[_loc4_][0] == Avatar.PROFESSOR)
|
||||
{
|
||||
_loc6_ = new ArcSprite(16,_loc3_,Avatar.PROFESSOR_SPRITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_ = new ArcSprite(16,_loc3_,Avatar.SAGA_SPRITE);
|
||||
}
|
||||
_loc3_ += Math.max(_loc5_.height,_loc6_.height) + 4;
|
||||
if(_loc3_ >= 221)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this._messages.add(_loc6_);
|
||||
this._messages.add(_loc5_);
|
||||
_loc4_--;
|
||||
}
|
||||
this._messages.setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
this._messages.update();
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
super.draw();
|
||||
this._messages.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/218_com.arc.dh.menu.MessageLogPane_sprite.png")]
|
||||
public class MessageLogPane_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function MessageLogPane_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.MainMenu;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.DataSerializer;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import com.arc.flixel.ArcButtonGroup;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class OptionsMenu extends ArcGroup
|
||||
{
|
||||
|
||||
public static const resetButton:Class = OptionsMenu_resetButton;
|
||||
|
||||
private var windowSprite:Class;
|
||||
|
||||
private var mouseSprite:Class;
|
||||
|
||||
private var kb1Sprite:Class;
|
||||
|
||||
private var kb2Sprite:Class;
|
||||
|
||||
private var slowSprite:Class;
|
||||
|
||||
private var medSprite:Class;
|
||||
|
||||
private var fastSprite:Class;
|
||||
|
||||
private var onSprite:Class;
|
||||
|
||||
private var offSprite:Class;
|
||||
|
||||
private var closeSprite:Class;
|
||||
|
||||
public var falsify:Function;
|
||||
|
||||
public var mouse:ArcButton;
|
||||
|
||||
public var kb1:ArcButton;
|
||||
|
||||
public var kb2:ArcButton;
|
||||
|
||||
public var reset:ArcButton;
|
||||
|
||||
public function OptionsMenu(param1:Function)
|
||||
{
|
||||
var window:ArcSprite;
|
||||
var controlGroup:ArcButtonGroup;
|
||||
var textGroup:ArcButtonGroup;
|
||||
var soundEffects:ArcButtonGroup;
|
||||
var music:ArcButtonGroup;
|
||||
var falsify:Function = param1;
|
||||
this.windowSprite = OptionsMenu_windowSprite;
|
||||
this.mouseSprite = OptionsMenu_mouseSprite;
|
||||
this.kb1Sprite = OptionsMenu_kb1Sprite;
|
||||
this.kb2Sprite = OptionsMenu_kb2Sprite;
|
||||
this.slowSprite = OptionsMenu_slowSprite;
|
||||
this.medSprite = OptionsMenu_medSprite;
|
||||
this.fastSprite = OptionsMenu_fastSprite;
|
||||
this.onSprite = OptionsMenu_onSprite;
|
||||
this.offSprite = OptionsMenu_offSprite;
|
||||
this.closeSprite = OptionsMenu_closeSprite;
|
||||
super();
|
||||
this.falsify = falsify;
|
||||
window = new ArcSprite(31,65,this.windowSprite);
|
||||
this.add(window);
|
||||
controlGroup = new ArcButtonGroup();
|
||||
this.add(this.mouse = new ArcButton(166,window.y + 22,45,13,this.mouseSprite).setGroup(controlGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.control = Data.CONTROL_MOUSE;
|
||||
}).select(Data.control == Data.CONTROL_MOUSE));
|
||||
this.add(this.kb1 = new ArcButton(216,window.y + 22,45,13,this.kb1Sprite).setGroup(controlGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.control = Data.CONTROL_KEYBOARD;
|
||||
}).select(Data.control == Data.CONTROL_KEYBOARD));
|
||||
this.add(this.kb2 = new ArcButton(266,window.y + 22,45,13,this.kb2Sprite).setGroup(controlGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.control = Data.CONTROL_KEYBOARDI;
|
||||
}).select(Data.control == Data.CONTROL_KEYBOARDI));
|
||||
textGroup = new ArcButtonGroup();
|
||||
this.add(new ArcButton(166,window.y + 36,45,13,this.slowSprite).setGroup(textGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.textspeed = Data.SPEED_SLOW;
|
||||
}).select(Data.textspeed == Data.SPEED_SLOW));
|
||||
this.add(new ArcButton(216,window.y + 36,45,13,this.medSprite).setGroup(textGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.textspeed = Data.SPEED_MED;
|
||||
}).select(Data.textspeed == Data.SPEED_MED));
|
||||
this.add(new ArcButton(266,window.y + 36,45,13,this.fastSprite).setGroup(textGroup,true).selectable(true).callback(function():void
|
||||
{
|
||||
Data.textspeed = Data.SPEED_FAST;
|
||||
}).select(Data.textspeed == Data.SPEED_FAST));
|
||||
soundEffects = new ArcButtonGroup();
|
||||
this.add(new ArcButton(191,window.y + 50,45,13,this.offSprite).setGroup(soundEffects,true).selectable(true).callback(function():void
|
||||
{
|
||||
SoundSystem.muteSounds();
|
||||
}).select(Data.sound == Data.OFF));
|
||||
this.add(new ArcButton(241,window.y + 50,45,13,this.onSprite).setGroup(soundEffects,true).selectable(true).callback(function():void
|
||||
{
|
||||
SoundSystem.unmuteSounds();
|
||||
}).select(Data.sound == Data.ON));
|
||||
music = new ArcButtonGroup();
|
||||
this.add(new ArcButton(191,window.y + 64,45,13,this.offSprite).setGroup(music,true).selectable(true).callback(function():void
|
||||
{
|
||||
SoundSystem.mute();
|
||||
}).select(Data.music == Data.OFF));
|
||||
this.add(new ArcButton(241,window.y + 64,45,13,this.onSprite).setGroup(music,true).selectable(true).callback(function():void
|
||||
{
|
||||
SoundSystem.unmute();
|
||||
}).select(Data.music == Data.ON));
|
||||
this.add(new ArcButton(window.x + 52,window.y + 95,193,16,this.closeSprite).selectable(false).callback(function():void
|
||||
{
|
||||
DataSerializer.save();
|
||||
falsify();
|
||||
}));
|
||||
this.add(this.reset = new ArcButton(window.x + 10,window.y + 82,33,23,resetButton).selectable(false).callback(function():void
|
||||
{
|
||||
if(FlxG.keys.SHIFT)
|
||||
{
|
||||
DataSerializer.reset();
|
||||
FlxG.fade(4278190080,0.25,function():void
|
||||
{
|
||||
FlxG.mouse.hide();
|
||||
FlxG.switchState(new MainMenu());
|
||||
});
|
||||
}
|
||||
}));
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/118_com.arc.dh.menu.OptionsMenu_closeSprite.png")]
|
||||
public class OptionsMenu_closeSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_closeSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/167_com.arc.dh.menu.OptionsMenu_fastSprite.png")]
|
||||
public class OptionsMenu_fastSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_fastSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/296_com.arc.dh.menu.OptionsMenu_kb1Sprite.png")]
|
||||
public class OptionsMenu_kb1Sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_kb1Sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/169_com.arc.dh.menu.OptionsMenu_kb2Sprite.png")]
|
||||
public class OptionsMenu_kb2Sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_kb2Sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/177_com.arc.dh.menu.OptionsMenu_medSprite.png")]
|
||||
public class OptionsMenu_medSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_medSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/135_com.arc.dh.menu.OptionsMenu_mouseSprite.png")]
|
||||
public class OptionsMenu_mouseSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_mouseSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/291_com.arc.dh.menu.OptionsMenu_offSprite.png")]
|
||||
public class OptionsMenu_offSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_offSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/275_com.arc.dh.menu.OptionsMenu_onSprite.png")]
|
||||
public class OptionsMenu_onSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_onSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/82_com.arc.dh.menu.OptionsMenu_resetButton.png")]
|
||||
public class OptionsMenu_resetButton extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_resetButton()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/248_com.arc.dh.menu.OptionsMenu_slowSprite.png")]
|
||||
public class OptionsMenu_slowSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_slowSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/137_com.arc.dh.menu.OptionsMenu_windowSprite.png")]
|
||||
public class OptionsMenu_windowSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function OptionsMenu_windowSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.DataSerializer;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class SkillMeter extends ArcGroup
|
||||
{
|
||||
|
||||
private static const barSprite:Class = SkillMeter_barSprite;
|
||||
|
||||
private static const diamondSprite:Class = SkillMeter_diamondSprite;
|
||||
|
||||
private static const COSTS:Array = [50,100,175,250,350,450,600,800,1200,1500,-1];
|
||||
|
||||
private var _bg:ArcSprite;
|
||||
|
||||
private var _bar:ArcSprite;
|
||||
|
||||
private var _skill:String;
|
||||
|
||||
private var _name:FlxBitmapText;
|
||||
|
||||
private var _diamond:ArcSprite;
|
||||
|
||||
private var _cost:FlxBitmapText;
|
||||
|
||||
public function SkillMeter(param1:Number, param2:Number, param3:String)
|
||||
{
|
||||
super(param1,param2);
|
||||
this._skill = param3;
|
||||
this._bg = new ArcSprite(-2,0);
|
||||
this._bg.makeGraphic(127,7,4294967295);
|
||||
this._bg.alpha = 0.1;
|
||||
this.add(this._bg);
|
||||
this._bar = new ArcSprite(36,0);
|
||||
this._bar.loadGraphic(barSprite,true,false,53,7);
|
||||
this._bar.frame = Math.random() * 10;
|
||||
this.add(this._bar);
|
||||
this._name = new FlxBitmapText(0,1,Fonts.font(Fonts.SMALL_WHITE),param3.toUpperCase(),"left",1000);
|
||||
this._name.alpha = 0.9;
|
||||
this.add(this._name);
|
||||
this._diamond = new ArcSprite(115,-1);
|
||||
this._diamond.loadGraphic(diamondSprite,true,false,8,8);
|
||||
this.add(this._diamond);
|
||||
this._cost = new FlxBitmapText(13,1,Fonts.font(Fonts.SMALL_WHITE),param3,"right",100);
|
||||
this.add(this._cost);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
this.sync();
|
||||
}
|
||||
|
||||
private function getDescription() : String
|
||||
{
|
||||
switch(this._skill)
|
||||
{
|
||||
case "agility":
|
||||
return "Increases movement speed";
|
||||
case "jump":
|
||||
return "Increases jump height";
|
||||
case "attract":
|
||||
return "Increases diamond attraction";
|
||||
case "recover":
|
||||
return "Increases speed of recover after knockback";
|
||||
case "aegis":
|
||||
return "Increases invulnerability time after being hit";
|
||||
case "defense":
|
||||
return "Decreases damage from higher level enemies";
|
||||
default:
|
||||
return "THE FUCK!?";
|
||||
}
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._bg.hover())
|
||||
{
|
||||
this._bg.alpha = 0.4;
|
||||
if(FlxG.mouse.justPressed())
|
||||
{
|
||||
if(Data[this._skill] < 10 && Data.diamonds >= this.cost())
|
||||
{
|
||||
SoundSystem.play(Sound.BUY);
|
||||
Data.diamonds -= this.cost();
|
||||
++Data[this._skill];
|
||||
this.sync();
|
||||
AchievementSystem.skills();
|
||||
DataSerializer.save();
|
||||
}
|
||||
}
|
||||
if(Menu.tooltip == null || Menu.tooltip.source != this)
|
||||
{
|
||||
Menu.tooltip = new MenuTooltip(this._bg.x + this._bg.width / 2,this._bg.y - 1,this._skill.toUpperCase(),this.getDescription().toUpperCase());
|
||||
Menu.tooltip.source = this;
|
||||
}
|
||||
Menu.hovering = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._bg.alpha = 0.1;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function sync() : void
|
||||
{
|
||||
this._bar.frame = Data[this._skill];
|
||||
var _loc1_:int = this.cost();
|
||||
this._cost.text = _loc1_ == -1 ? "" : _loc1_.toString();
|
||||
this._diamond.frame = _loc1_ == -1 ? 4 : (_loc1_ > Data.diamonds ? 3 : 1);
|
||||
}
|
||||
|
||||
private function cost() : int
|
||||
{
|
||||
return COSTS[Data[this._skill]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/111_com.arc.dh.menu.SkillMeter_barSprite.png")]
|
||||
public class SkillMeter_barSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function SkillMeter_barSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/146.png")]
|
||||
public class SkillMeter_diamondSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function SkillMeter_diamondSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.dh.state.Chapter;
|
||||
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.FlxPoint;
|
||||
|
||||
public class StatisticsChapter extends ArcGroup
|
||||
{
|
||||
|
||||
public static const bgSprite:Class = StatisticsChapter_bgSprite;
|
||||
|
||||
public static const heartCrystalObtained:Class = StatisticsChapter_heartCrystalObtained;
|
||||
|
||||
public static const heartCrystalUnobtained:Class = StatisticsChapter_heartCrystalUnobtained;
|
||||
|
||||
public static const redDiamondObtained:Class = StatisticsChapter_redDiamondObtained;
|
||||
|
||||
public static const redDiamondUnobtained:Class = StatisticsChapter_redDiamondUnobtained;
|
||||
|
||||
private static const startHearts:Array = [0,3,6,9,11,13,15];
|
||||
|
||||
private static const HEARTS:Array = [[0,1,14],[2,3,15],[4,5,16],[6,7],[8,9],[10,11],[12,13]];
|
||||
|
||||
private var bg:ArcSprite;
|
||||
|
||||
private var chapter:int;
|
||||
|
||||
private var badge:ArcSprite;
|
||||
|
||||
private var time:FlxBitmapText;
|
||||
|
||||
private var hearts:Array = new Array();
|
||||
|
||||
private var diamonds:Array = new Array();
|
||||
|
||||
public function StatisticsChapter(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
var _loc7_:ArcSprite = null;
|
||||
var _loc8_:ArcSprite = null;
|
||||
super(param1,param2);
|
||||
this.chapter = param3;
|
||||
this.bg = new ArcSprite(-2,-2,bgSprite);
|
||||
this.add(this.bg);
|
||||
this.badge = new ArcSprite(0,-1);
|
||||
this.badge.loadGraphic(Chapter.badgesSprite,true,false,16,9);
|
||||
this.add(this.badge);
|
||||
this.time = new FlxBitmapText(64,0,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"4:27","right",50);
|
||||
this.add(this.time);
|
||||
var _loc4_:int = param3 < 3 ? 3 : 2;
|
||||
var _loc5_:int = 0;
|
||||
while(_loc5_ < _loc4_)
|
||||
{
|
||||
_loc7_ = new ArcSprite(122 + _loc5_ * 12 + (_loc4_ == 2 ? 6 : 0),-1);
|
||||
this.add(_loc7_);
|
||||
this.hearts.push(_loc7_);
|
||||
_loc5_++;
|
||||
}
|
||||
var _loc6_:int = 5;
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc6_)
|
||||
{
|
||||
_loc8_ = new ArcSprite(164 + _loc5_ * 10,-2);
|
||||
this.add(_loc8_);
|
||||
this.diamonds.push(_loc8_);
|
||||
_loc5_++;
|
||||
}
|
||||
this.sync();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this.bg.hover())
|
||||
{
|
||||
this.bg.alpha = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bg.alpha = 0.3;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function sync() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc4_:String = null;
|
||||
var _loc5_:String = null;
|
||||
var _loc6_:ArcSprite = null;
|
||||
var _loc7_:ArcSprite = null;
|
||||
this.badge.frame = Data.chapters[this.chapter][0] == 0 ? 4 : 2;
|
||||
if(Data.chapters[this.chapter][1] != 0)
|
||||
{
|
||||
_loc4_ = Data.duration(0,Data.chapters[this.chapter][1]);
|
||||
_loc5_ = _loc4_.substr(_loc4_.indexOf(":") + 1);
|
||||
this.time.text = _loc5_;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.time.text = "--:--";
|
||||
}
|
||||
_loc1_ = 0;
|
||||
while(_loc1_ < this.diamonds.length)
|
||||
{
|
||||
_loc6_ = this.diamonds[_loc1_] as ArcSprite;
|
||||
if(Data.hasRed(this.chapter + 1,4 - _loc1_))
|
||||
{
|
||||
_loc6_.loadGraphic(redDiamondObtained,true,false,10,10);
|
||||
_loc6_.addAnimation("glow",[0,1,2,3,4,5,4,3,2,1],5,true);
|
||||
_loc6_.play("glow");
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_.loadGraphic(redDiamondUnobtained,false,false,10,10);
|
||||
_loc6_.frame = 0;
|
||||
}
|
||||
_loc1_++;
|
||||
}
|
||||
var _loc2_:Array = HEARTS[this.chapter];
|
||||
var _loc3_:int = 0;
|
||||
for each(_loc1_ in _loc2_)
|
||||
{
|
||||
_loc7_ = this.hearts[_loc3_] as ArcSprite;
|
||||
if(Data.heartcrystals[_loc1_] == 1)
|
||||
{
|
||||
_loc7_.loadGraphic(heartCrystalObtained,false,false);
|
||||
_loc7_.frame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_.loadGraphic(heartCrystalUnobtained,false,false);
|
||||
_loc7_.frame = 0;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/61_com.arc.dh.menu.StatisticsChapter_bgSprite.png")]
|
||||
public class StatisticsChapter_bgSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsChapter_bgSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/304_com.arc.dh.menu.StatisticsChapter_heartCrystalObtained.png")]
|
||||
public class StatisticsChapter_heartCrystalObtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsChapter_heartCrystalObtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/190_com.arc.dh.menu.StatisticsChapter_heartCrystalUnobtained.png")]
|
||||
public class StatisticsChapter_heartCrystalUnobtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsChapter_heartCrystalUnobtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/175_com.arc.dh.menu.StatisticsChapter_redDiamondObtained.png")]
|
||||
public class StatisticsChapter_redDiamondObtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsChapter_redDiamondObtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/114_com.arc.dh.menu.StatisticsChapter_redDiamondUnobtained.png")]
|
||||
public class StatisticsChapter_redDiamondUnobtained extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsChapter_redDiamondUnobtained()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import Playtomic.Link;
|
||||
import com.arc.dh.state.Trophy;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Fonts;
|
||||
import com.arc.flixel.ArcButton;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class StatisticsPane extends MenuPane
|
||||
{
|
||||
|
||||
private static const sprite:Class = StatisticsPane_sprite;
|
||||
|
||||
private static const refreshSprite:Class = StatisticsPane_refreshSprite;
|
||||
|
||||
private static const pegasSprite:Class = StatisticsPane_pegasSprite;
|
||||
|
||||
private var _chapters:Array;
|
||||
|
||||
private var _tiptext:FlxBitmapText;
|
||||
|
||||
private var _statistics:Array;
|
||||
|
||||
private var _statisticsTexts:Array;
|
||||
|
||||
private var _completion:FlxBitmapText;
|
||||
|
||||
private var _trophies:Array;
|
||||
|
||||
private var _buttonPegas:ArcButton;
|
||||
|
||||
public function StatisticsPane()
|
||||
{
|
||||
var refresh:ArcButton;
|
||||
var i:int = 0;
|
||||
var rx:int = 0;
|
||||
var ry:int = 0;
|
||||
var chapter:StatisticsChapter = null;
|
||||
var t:Trophy = null;
|
||||
this._chapters = new Array();
|
||||
this._statistics = new Array();
|
||||
this._statisticsTexts = new Array();
|
||||
this._trophies = new Array();
|
||||
super(1,1,sprite);
|
||||
i = 0;
|
||||
while(i < 7)
|
||||
{
|
||||
rx = 14;
|
||||
ry = 21 + i * 13;
|
||||
chapter = new StatisticsChapter(rx,ry,i);
|
||||
this.add(chapter);
|
||||
this._chapters.push(chapter);
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
while(i < AchievementSystem.achievements.length)
|
||||
{
|
||||
t = new Trophy(249 + i % 5 * 20,24 + Math.floor(i / 5) * 20,i);
|
||||
this._trophies.push(t);
|
||||
this.add(t);
|
||||
i++;
|
||||
}
|
||||
this._tiptext = new FlxBitmapText(134,151,Fonts.font(Fonts.OUTLINE_BLACK),Tip.random(),"center",102);
|
||||
this.add(this._tiptext);
|
||||
refresh = new ArcButton(203,137,11,11,refreshSprite).selectable(false).callback(function():void
|
||||
{
|
||||
_tiptext.text = Tip.random();
|
||||
});
|
||||
this.add(refresh);
|
||||
this.addStatistic("total diamonds",function():int
|
||||
{
|
||||
return Data.totaldiamonds;
|
||||
});
|
||||
this.addStatistic("escape height",function():int
|
||||
{
|
||||
return Data.maxheight;
|
||||
});
|
||||
this.addStatistic("enemies killed",function():int
|
||||
{
|
||||
return Data.enemies;
|
||||
});
|
||||
this.addStatistic("upgrades",function():String
|
||||
{
|
||||
return Data.upgrades + "/60";
|
||||
});
|
||||
this.addStatistic("deaths",function():int
|
||||
{
|
||||
return Data.deaths;
|
||||
});
|
||||
this.addStatistic("playtime",function():String
|
||||
{
|
||||
return Data.duration(0,Data.time * 1000);
|
||||
});
|
||||
this.addStatistic("bullets fired",function():int
|
||||
{
|
||||
return Data.bullets;
|
||||
});
|
||||
this.addStatistic("achievements",function():String
|
||||
{
|
||||
return Data.getAchievementCount() + "/45";
|
||||
});
|
||||
this._completion = new FlxBitmapText(134,126,Fonts.font(Fonts.BEVEL_YELLOW),"","center",104);
|
||||
this.add(this._completion);
|
||||
if(Config.RELEASE == Config.PEGAS)
|
||||
{
|
||||
this._buttonPegas = new ArcButton(134,196,103,17,pegasSprite).callback(function():void
|
||||
{
|
||||
Link.Open("http://www.pegasgames.com/","StatisticsMenu","Sponsor");
|
||||
}).selectable(false);
|
||||
this.add(this._buttonPegas);
|
||||
}
|
||||
this.sync();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
public function clickTryAgain() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function clickMenu() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function sync(param1:Boolean = false) : void
|
||||
{
|
||||
var _loc2_:StatisticsChapter = null;
|
||||
var _loc3_:Array = null;
|
||||
var _loc4_:Trophy = null;
|
||||
var _loc5_:FlxBitmapText = null;
|
||||
var _loc6_:Function = null;
|
||||
for each(_loc2_ in this._chapters)
|
||||
{
|
||||
_loc2_.sync();
|
||||
}
|
||||
this._tiptext.text = Tip.random();
|
||||
this._completion.text = Data.completion + "% COMPLETE";
|
||||
for each(_loc3_ in this._statistics)
|
||||
{
|
||||
_loc5_ = _loc3_[0] as FlxBitmapText;
|
||||
_loc6_ = _loc3_[1] as Function;
|
||||
_loc5_.text = _loc6_();
|
||||
}
|
||||
for each(_loc4_ in this._trophies)
|
||||
{
|
||||
_loc4_.sync();
|
||||
}
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function addStatistic(param1:String, param2:Function) : void
|
||||
{
|
||||
var _loc3_:int = int(this._statistics.length);
|
||||
var _loc4_:FlxBitmapText = new FlxBitmapText(14,126 + 10 * _loc3_,Fonts.font(Fonts.OUTLINE_BLACK_S),param1.toUpperCase(),"left",109);
|
||||
var _loc5_:FlxBitmapText = new FlxBitmapText(_loc4_.x,_loc4_.y,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"","right",109);
|
||||
this.add(_loc4_);
|
||||
this.add(_loc5_);
|
||||
this._statistics.push([_loc5_,param2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/229_com.arc.dh.menu.StatisticsPane_pegasSprite.png")]
|
||||
public class StatisticsPane_pegasSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsPane_pegasSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/223_com.arc.dh.menu.StatisticsPane_refreshSprite.png")]
|
||||
public class StatisticsPane_refreshSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsPane_refreshSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/247_com.arc.dh.menu.StatisticsPane_sprite.png")]
|
||||
public class StatisticsPane_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function StatisticsPane_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.arc.dh.menu
|
||||
{
|
||||
import com.arc.flixel.ArcU;
|
||||
|
||||
public class Tip
|
||||
{
|
||||
|
||||
private static var tips:Array = ["Upgrading your defense will reduce the damage you take from higher level enemies.","Upgrading your gun power will allow you to defeat enemies quicker.","Red diamonds are often hidden in secret areas. Be sure to search everywhere!","If you are having a hard time, search for Heart Crystals to increase your maximum hit points.","You can collect diamonds to upgrade in any mode. If you have trouble, try another mode!","Remember to grab checkpoints in story mode in case you die!","You can change the control scheme in the options menu.","Upgrade your attract skill to attract diamonds easier if you want to collect diamonds more quickly.","Once you acquire the x-ray scope, you can search for hidden red diamonds and heart crystals more easily.","Tired of the music? You can turn it off in options!","Holding down jump allows you to jump higher. Practice double jumping at the peak!","Stuck on a boss? Try a different gun! Each is useful in its own way!","Don\'t forget to upgrade your defense in order to take less damage."
|
||||
,"The subtle patterns on slimes tell you which movement pattern they will use.","Upgrade to the latest flash player and use new versions of Chrome or Firefox if you have issues!","Golden plants cannot be killed during boss encounters.","You can also use the mouse wheel or Q and E to switch weapons."];
|
||||
|
||||
public function Tip()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function random() : String
|
||||
{
|
||||
return (tips[ArcU.rand(0,tips.length - 1)] as String).toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.entities.Entity;
|
||||
import com.arc.dh.entities.Player;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class BossDoor extends Entity
|
||||
{
|
||||
|
||||
private static const sprite:Class = BossDoor_sprite;
|
||||
|
||||
private var _c:int;
|
||||
|
||||
private var _r:int;
|
||||
|
||||
private var _locked:Boolean = false;
|
||||
|
||||
public function BossDoor(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
var _loc4_:Number = param1 * Config.BLOCK_SIZE;
|
||||
var _loc5_:Number = param2 * Config.BLOCK_SIZE;
|
||||
super(_loc4_,_loc5_);
|
||||
this._c = param1;
|
||||
this._r = param2;
|
||||
if(Data.state.player.y > y && Data.state.tilemap.getTile(this._c,this._r) != 0)
|
||||
{
|
||||
Data.state.tilemap.setTile(this._c,this._r,0,true);
|
||||
}
|
||||
loadGraphic(sprite,true,false,12,12);
|
||||
immovable = true;
|
||||
solid = false;
|
||||
visible = true;
|
||||
alpha = 0.35;
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(outside)
|
||||
{
|
||||
}
|
||||
var _loc1_:Player = Data.state.player;
|
||||
if(!this._locked && _loc1_.y <= y && (Boolean(_loc1_.touching & DOWN) || Boolean(_loc1_.wasTouching & DOWN)))
|
||||
{
|
||||
this._locked = true;
|
||||
visible = false;
|
||||
Data.state.tilemap.setTile(this._c,this._r,56,true);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.RED,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.GREEN,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.YELLOW,getMidpoint().x,getMidpoint().y,2,1,1,0,-50,50,-50,50);
|
||||
Data.state.setBoss(y);
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/102_com.arc.dh.objects.BossDoor_sprite.png")]
|
||||
public class BossDoor_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BossDoor_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxObject;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class Bullet extends ArcSprite
|
||||
{
|
||||
|
||||
protected var _collider:FlxObject;
|
||||
|
||||
private var _dir:Number;
|
||||
|
||||
private var _speed:Number;
|
||||
|
||||
public var damage:int;
|
||||
|
||||
public function Bullet(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2);
|
||||
velocity.x = param3 * Math.cos(param4);
|
||||
velocity.y = param3 * Math.sin(param4);
|
||||
this._dir = param4;
|
||||
this._speed = param3;
|
||||
if(Data.state is HorizontalMode)
|
||||
{
|
||||
velocity.x += (Data.state as HorizontalMode).camera.velocity.x;
|
||||
}
|
||||
x += velocity.x * 0.005;
|
||||
y += velocity.y * 0.005;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this.offScreen())
|
||||
{
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function offScreen() : Boolean
|
||||
{
|
||||
var _loc1_:FlxPoint = getScreenXY();
|
||||
return _loc1_.x < -width || _loc1_.x > FlxG.width || _loc1_.y < -height - 60 || _loc1_.y > FlxG.height + 60;
|
||||
}
|
||||
|
||||
public function setCollider(param1:FlxObject) : void
|
||||
{
|
||||
this._collider = param1;
|
||||
}
|
||||
|
||||
public function shift(param1:Number, param2:int = 1) : Bullet
|
||||
{
|
||||
var _loc3_:Number = this._dir + Math.PI / 2 * param2;
|
||||
x += this._speed * param1 * Math.cos(_loc3_);
|
||||
y += this._speed * param1 * Math.sin(_loc3_);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Gun;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
|
||||
public class BulletFactory
|
||||
{
|
||||
|
||||
public static var nonMissile:Boolean = false;
|
||||
|
||||
public function BulletFactory()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function create(param1:Number, param2:Number, param3:Number, param4:Number, param5:Class) : Bullet
|
||||
{
|
||||
var _loc6_:Bullet = new param5(param1,param2,param3,param4);
|
||||
_loc6_.damage = damage(param5);
|
||||
++Data.bullets;
|
||||
AchievementSystem.bullets();
|
||||
if(param5 != Missile && param5 != BulletFragment)
|
||||
{
|
||||
nonMissile = true;
|
||||
}
|
||||
return _loc6_;
|
||||
}
|
||||
|
||||
public static function damage(param1:Class) : int
|
||||
{
|
||||
switch(param1)
|
||||
{
|
||||
case BulletPrime:
|
||||
return Gun.PRIME_DAMAGE[Data.primegun[0]];
|
||||
case BulletSpreader:
|
||||
return Gun.SPREADER_DAMAGE[Data.spreadergun[0]];
|
||||
case Missile:
|
||||
return Gun.MISSILE_DAMAGE[Data.missilegun[0]];
|
||||
case BulletRebound:
|
||||
return Gun.REBOUND_DAMAGE[Data.reboundgun[0]];
|
||||
case BulletFragment:
|
||||
return Gun.MISSILE_DAMAGE[Data.missilegun[0]] / 8;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class BulletFragment extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = BulletFragment_sprite;
|
||||
|
||||
public function BulletFragment(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadGraphic(sprite,false,false,4,4);
|
||||
width = height = 2;
|
||||
offset.x = offset.y = 1;
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
if(touching & UP)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,0,20);
|
||||
}
|
||||
else if(touching & DOWN)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + height,3,1,3,400,-60,60,-100,0);
|
||||
}
|
||||
else if(touching & LEFT)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x,y + height / 2,3,1,3,400,0,60,-100,0);
|
||||
}
|
||||
else if(touching & RIGHT)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width,y + height / 2,3,1,3,400,-60,0,-100,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,-100,0);
|
||||
}
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/253_com.arc.dh.objects.BulletFragment_sprite.png")]
|
||||
public class BulletFragment_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BulletFragment_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class BulletPrime extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = BulletPrime_sprite;
|
||||
|
||||
public function BulletPrime(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadGraphic(sprite,false,false,4,4);
|
||||
width = height = 2;
|
||||
offset.x = offset.y = 1;
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
if(touching & UP)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,0,20);
|
||||
}
|
||||
else if(touching & DOWN)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + height,3,1,3,400,-60,60,-100,0);
|
||||
}
|
||||
else if(touching & LEFT)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x,y + height / 2,3,1,3,400,0,60,-100,0);
|
||||
}
|
||||
else if(touching & RIGHT)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width,y + height / 2,3,1,3,400,-60,0,-100,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y,3,1,3,400,-60,60,-100,0);
|
||||
}
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/233_com.arc.dh.objects.BulletPrime_sprite.png")]
|
||||
public class BulletPrime_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BulletPrime_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Gun;
|
||||
import com.arc.dh.objects.enemies.Enemy;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import com.arc.flixel.ArcU;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class BulletRebound extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = BulletRebound_sprite;
|
||||
|
||||
private static const SOLID_TIME:Number = 0.15;
|
||||
|
||||
private var bounces:int = 2;
|
||||
|
||||
public var solidTimer:Number = 0.15;
|
||||
|
||||
private var side:String = "";
|
||||
|
||||
private var _vx:Number;
|
||||
|
||||
private var _vy:Number;
|
||||
|
||||
public var lastEnemy:Enemy;
|
||||
|
||||
public function BulletRebound(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadGraphic(sprite,false,false,4,4);
|
||||
this._vx = velocity.x;
|
||||
this._vy = velocity.y;
|
||||
this.bounces = Data.reboundgun[Gun.SPECIAL_ONE] == 1 ? 3 : 2;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this.solidTimer > 0)
|
||||
{
|
||||
this.solidTimer -= FlxG.elapsed;
|
||||
if(this.solidTimer <= 0)
|
||||
{
|
||||
solid = true;
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
var _loc1_:Number = NaN;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:FlxPoint = null;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc6_:FlxPoint = null;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc9_:Number = NaN;
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc12_:Number = NaN;
|
||||
if(this.bounces > 0 && _collider != null)
|
||||
{
|
||||
this.solidTimer = SOLID_TIME;
|
||||
--this.bounces;
|
||||
_loc1_ = velocity.x * FlxG.elapsed;
|
||||
_loc2_ = velocity.y * FlxG.elapsed;
|
||||
if(touching & (UP | DOWN))
|
||||
{
|
||||
this._vy = 0 - this._vy;
|
||||
velocity.y = this._vy;
|
||||
velocity.x = this._vx;
|
||||
}
|
||||
else if(touching & (LEFT | RIGHT))
|
||||
{
|
||||
this._vx = 0 - this._vx;
|
||||
velocity.y = this._vy;
|
||||
velocity.x = this._vx;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = _collider.getMidpoint();
|
||||
_loc4_ = _loc3_.x;
|
||||
_loc5_ = _loc3_.y;
|
||||
_loc6_ = getMidpoint();
|
||||
_loc7_ = _loc6_.x;
|
||||
_loc8_ = _loc6_.y;
|
||||
_loc9_ = _loc7_ - _loc4_;
|
||||
_loc10_ = _loc8_ - _loc5_;
|
||||
_loc11_ = ArcU.abs(_loc9_);
|
||||
_loc12_ = ArcU.abs(_loc10_);
|
||||
if((_loc11_ > _loc12_ || _loc8_ <= _loc5_ && velocity.y <= 0 || _loc8_ >= _loc5_ && velocity.y >= 0) && (_loc7_ <= _loc4_ && velocity.x >= 0 || _loc7_ >= _loc4_ && velocity.x <= 0))
|
||||
{
|
||||
this._vx = 0 - this._vx;
|
||||
velocity.y = this._vy;
|
||||
velocity.x = this._vx;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._vy = 0 - this._vy;
|
||||
velocity.y = this._vy;
|
||||
velocity.x = this._vx;
|
||||
}
|
||||
}
|
||||
ArcParticleSystem.emit(Data.state.particles,"rebound",x + width / 2,y + width / 2,1,1,3,400,-60,60,-100,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"rebound",x + width / 2,y + width / 2,1,3,3,400,-60,60,-100,0);
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/158_com.arc.dh.objects.BulletRebound_sprite.png")]
|
||||
public class BulletRebound_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BulletRebound_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class BulletSpreader extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = BulletSpreader_sprite;
|
||||
|
||||
public static const spriteGreen:Class = BulletSpreader_spriteGreen;
|
||||
|
||||
public function BulletSpreader(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadGraphic(sprite,false,false,4,4);
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,"prime",x + width / 2,y + width / 2,1,1,3,400,-60,60,-100,0);
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
|
||||
public function green() : void
|
||||
{
|
||||
loadGraphic(spriteGreen,false,false,4,4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/295_com.arc.dh.objects.BulletSpreader_sprite.png")]
|
||||
public class BulletSpreader_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BulletSpreader_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/212_com.arc.dh.objects.BulletSpreader_spriteGreen.png")]
|
||||
public class BulletSpreader_spriteGreen extends BitmapAsset
|
||||
{
|
||||
|
||||
public function BulletSpreader_spriteGreen()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import org.flixel.FlxSprite;
|
||||
|
||||
public class Camera extends FlxSprite
|
||||
{
|
||||
|
||||
public function Camera(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2);
|
||||
width = height = 1;
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.objects.powerups.Powerup;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class Checkpoint extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = Checkpoint_sprite;
|
||||
|
||||
private static const spriteRed:Class = Checkpoint_spriteRed;
|
||||
|
||||
private var _activated:Boolean = false;
|
||||
|
||||
public function Checkpoint(param1:Number, param2:Number)
|
||||
{
|
||||
var _loc6_:Array = null;
|
||||
super(param1,param2);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
var _loc3_:Boolean = false;
|
||||
var _loc4_:Array = Data.state.checkpoints;
|
||||
var _loc5_:int = 0;
|
||||
while(_loc5_ < _loc4_.length)
|
||||
{
|
||||
_loc6_ = _loc4_[_loc5_];
|
||||
if(_loc6_[0] == param1 && _loc6_[1] == param2)
|
||||
{
|
||||
loadRotatedGraphic(spriteRed,32,-1,true,true);
|
||||
this._activated = true;
|
||||
_loc3_ = true;
|
||||
break;
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
if(!_loc3_)
|
||||
{
|
||||
loadRotatedGraphic(sprite,32,-1,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
angle += FlxG.elapsed * 300;
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
if(this._activated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
loadRotatedGraphic(spriteRed,32,-1,true,true);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.RED,x,y,25,1,2,0,-200,200,-200,200,width,height);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.BLACK,x,y,25,1,2,0,-200,200,-200,200,width,height);
|
||||
this._activated = true;
|
||||
Data.state.checkpoints.push([_c,_r]);
|
||||
Data.state.checkpoint();
|
||||
Data.hp = Data.hpm;
|
||||
SoundSystem.play(Sound.CHECKPOINT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/92_com.arc.dh.objects.Checkpoint_sprite.png")]
|
||||
public class Checkpoint_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Checkpoint_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/140_com.arc.dh.objects.Checkpoint_spriteRed.png")]
|
||||
public class Checkpoint_spriteRed extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Checkpoint_spriteRed()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.state.HorizontalMode;
|
||||
import com.arc.dh.state.TadpoleMode;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import com.arc.flixel.ArcU;
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxPoint;
|
||||
import org.flixel.FlxU;
|
||||
|
||||
public class Diamond extends ArcSprite
|
||||
{
|
||||
|
||||
private static const sprite:Class = Diamond_sprite;
|
||||
|
||||
private static const PULL_DISTANCE:int = 25;
|
||||
|
||||
private static const PULL_SPEED:int = 240;
|
||||
|
||||
public var value:int = 1;
|
||||
|
||||
public var pullDelay:Number = 0;
|
||||
|
||||
public var diamondColor:int = 0;
|
||||
|
||||
private var _pulled:Boolean = false;
|
||||
|
||||
private var _magnet:Boolean = false;
|
||||
|
||||
private var _hidden:Boolean = false;
|
||||
|
||||
private var _thisPoint:FlxPoint = new FlxPoint();
|
||||
|
||||
private var _otherPoint:FlxPoint = new FlxPoint();
|
||||
|
||||
private var outsideFunction:Function;
|
||||
|
||||
private var _c:int = -1;
|
||||
|
||||
private var _r:int = -1;
|
||||
|
||||
public function Diamond(param1:Number, param2:Number, param3:int = 1, param4:Boolean = false, param5:int = -1, param6:int = -1)
|
||||
{
|
||||
var _loc7_:int = 0;
|
||||
super(param1,param2);
|
||||
loadGraphic(sprite,true,false,10,10);
|
||||
this._hidden = param4;
|
||||
this._c = param5;
|
||||
this._r = param6;
|
||||
solid = false;
|
||||
this.value = param3;
|
||||
switch(param3)
|
||||
{
|
||||
case 1:
|
||||
_loc7_ = 0;
|
||||
this.diamondColor = Color.YELLOW;
|
||||
break;
|
||||
case 2:
|
||||
_loc7_ = 1;
|
||||
this.diamondColor = Color.GREEN;
|
||||
break;
|
||||
case 3:
|
||||
_loc7_ = 2;
|
||||
this.diamondColor = Color.CYAN;
|
||||
break;
|
||||
case 4:
|
||||
_loc7_ = 3;
|
||||
this.diamondColor = Color.BLUE;
|
||||
break;
|
||||
case 5:
|
||||
_loc7_ = 4;
|
||||
this.diamondColor = Color.PURPLE;
|
||||
break;
|
||||
case 6:
|
||||
_loc7_ = 5;
|
||||
this.diamondColor = Color.WHITE;
|
||||
break;
|
||||
case 10:
|
||||
_loc7_ = 6;
|
||||
this.diamondColor = Color.BLACK;
|
||||
break;
|
||||
default:
|
||||
_loc7_ = 0;
|
||||
this.diamondColor = Color.GREEN;
|
||||
}
|
||||
var _loc8_:int = _loc7_ * 6;
|
||||
addAnimation("glow",[_loc8_ + 0,_loc8_ + 1,_loc8_ + 2,_loc8_ + 3,_loc8_ + 4,_loc8_ + 5,_loc8_ + 4,_loc8_ + 3,_loc8_ + 2,_loc8_ + 1],ArcU.rand(5,12),true);
|
||||
play("glow");
|
||||
if(Data.state is HorizontalMode)
|
||||
{
|
||||
this.outsideFunction = this.runmodeOutside;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.outsideFunction = this.playmodeOutside;
|
||||
}
|
||||
}
|
||||
|
||||
public static function valueFromLevel(param1:int) : int
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1 < 9)
|
||||
{
|
||||
_loc2_ = 1;
|
||||
}
|
||||
else if(param1 < 20)
|
||||
{
|
||||
_loc2_ = 2;
|
||||
}
|
||||
else if(param1 < 31)
|
||||
{
|
||||
_loc2_ = 3;
|
||||
}
|
||||
else if(param1 < 42)
|
||||
{
|
||||
_loc2_ = 4;
|
||||
}
|
||||
else if(param1 < 53)
|
||||
{
|
||||
_loc2_ = 5;
|
||||
}
|
||||
else if(param1 < 61)
|
||||
{
|
||||
_loc2_ = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = 10;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function runmodeOutside() : Boolean
|
||||
{
|
||||
var _loc1_:int = x / Config.BLOCK_SIZE;
|
||||
if(_loc1_ <= Data.state.despawnTop - 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function playmodeOutside() : Boolean
|
||||
{
|
||||
var _loc1_:int = y / Config.BLOCK_SIZE;
|
||||
if(_loc1_ >= Data.state.despawnBottom + 2 || _loc1_ <= Data.state.despawnTop - 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get pullDistance() : int
|
||||
{
|
||||
if(Data.state is TadpoleMode)
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
return PULL_DISTANCE + Data.attract * 7;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
if(this.outsideFunction())
|
||||
{
|
||||
kill();
|
||||
}
|
||||
this.pullDelay -= FlxG.elapsed;
|
||||
var _loc1_:Boolean = !this._hidden || Data.state.player.inHidden > 0;
|
||||
if(_loc1_ && (this.pullDelay <= 0 || this._magnet))
|
||||
{
|
||||
this._thisPoint.x = x + 2;
|
||||
this._thisPoint.y = y + 2;
|
||||
this._otherPoint.x = Data.state.player.x + Data.state.player.width / 2;
|
||||
this._otherPoint.y = Data.state.player.y + Data.state.player.height / 2;
|
||||
_loc2_ = FlxU.getDistance(this._thisPoint,this._otherPoint);
|
||||
if(_loc2_ < this.pullDistance && Data.state.tilemap.ray(this._thisPoint,this._otherPoint) || this._magnet)
|
||||
{
|
||||
_loc3_ = FlxU.getAngle(this._thisPoint,this._otherPoint) - 90;
|
||||
_loc4_ = Math.PI / 180 * _loc3_;
|
||||
this._pulled = true;
|
||||
velocity.x = (PULL_SPEED + (this._magnet ? 150 : 0)) * Math.cos(_loc4_) + (Data.state is HorizontalMode ? (Data.state as HorizontalMode).camera.velocity.x : 0);
|
||||
velocity.y = (PULL_SPEED + (this._magnet ? 150 : 0)) * Math.sin(_loc4_);
|
||||
if(!this._magnet)
|
||||
{
|
||||
solid = true;
|
||||
}
|
||||
}
|
||||
else if(this._pulled)
|
||||
{
|
||||
velocity.x = velocity.y = 0;
|
||||
}
|
||||
if(_loc2_ < 4)
|
||||
{
|
||||
solid = true;
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function set magnet(param1:Boolean) : void
|
||||
{
|
||||
var _loc2_:int = getScreenXY().x;
|
||||
var _loc3_:int = getScreenXY().y;
|
||||
var _loc4_:Boolean = !this._hidden || Data.state.player.inHidden > 0;
|
||||
if(_loc2_ >= -width && _loc2_ < FlxG.width && _loc3_ >= -height && _loc3_ < FlxG.height && _loc4_)
|
||||
{
|
||||
this._magnet = true;
|
||||
solid = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function despawn() : void
|
||||
{
|
||||
if(this._c != -1 && this._r != -1)
|
||||
{
|
||||
Data.state.despawn(this._c,this._r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/262_com.arc.dh.objects.Diamond_sprite.png")]
|
||||
public class Diamond_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Diamond_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
|
||||
public class Healthbar extends ArcGroup
|
||||
{
|
||||
|
||||
public static const WIDTH:int = 15;
|
||||
|
||||
public static const HEIGHT:int = 6;
|
||||
|
||||
private static const BORDER_WIDTH:int = 2;
|
||||
|
||||
private var backgroundSprite:Class = Healthbar_backgroundSprite;
|
||||
|
||||
private var barSprite:Class = Healthbar_barSprite;
|
||||
|
||||
private var background:ArcSprite;
|
||||
|
||||
public var bar:ArcSprite;
|
||||
|
||||
public function Healthbar()
|
||||
{
|
||||
super();
|
||||
this.background = new ArcSprite(0,0);
|
||||
this.background.loadGraphic(this.backgroundSprite,false,false,WIDTH,HEIGHT);
|
||||
add(this.background);
|
||||
this.bar = new ArcSprite(BORDER_WIDTH,BORDER_WIDTH);
|
||||
this.bar.loadGraphic(this.barSprite,false,false,11,2);
|
||||
this.bar.origin.x = this.bar.origin.y = 0;
|
||||
this.bar.addAnimation("red",[0]);
|
||||
this.bar.addAnimation("gold",[1]);
|
||||
this.bar.play("red");
|
||||
add(this.bar);
|
||||
alive = true;
|
||||
exists = true;
|
||||
}
|
||||
|
||||
public function move(param1:int, param2:int, param3:Number) : void
|
||||
{
|
||||
this.background.alpha = param3;
|
||||
this.background.x = param1;
|
||||
this.background.y = param2;
|
||||
this.bar.alpha = param3;
|
||||
this.bar.x = param1 + BORDER_WIDTH;
|
||||
this.bar.y = param2 + BORDER_WIDTH;
|
||||
}
|
||||
|
||||
public function scale(param1:Number) : void
|
||||
{
|
||||
this.bar.scale.x = param1;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/230_com.arc.dh.objects.Healthbar_backgroundSprite.png")]
|
||||
public class Healthbar_backgroundSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Healthbar_backgroundSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/207_com.arc.dh.objects.Healthbar_barSprite.png")]
|
||||
public class Healthbar_barSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Healthbar_barSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class Missile extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = Missile_sprite;
|
||||
|
||||
private var _particleTime:Number = 0;
|
||||
|
||||
public function Missile(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadRotatedGraphic(sprite,60,-1,true,false);
|
||||
width = 3;
|
||||
height = 3;
|
||||
offset.x = 6;
|
||||
offset.y = 6;
|
||||
angle = param4 * 57.2957795;
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
this._particleTime -= FlxG.elapsed;
|
||||
if(this._particleTime <= 0)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLACK,getMidpoint().x,getMidpoint().y,1,1,0,0,0,0,0,0);
|
||||
this._particleTime = 0.02;
|
||||
}
|
||||
super.draw();
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLACK,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.WHITE,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30);
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/91_com.arc.dh.objects.Missile_sprite.png")]
|
||||
public class Missile_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Missile_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user