initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
public class Achievement
|
||||
{
|
||||
|
||||
public static const DIAMONDS_1:int = 0;
|
||||
|
||||
public static const ENEMIES_1:int = 1;
|
||||
|
||||
public static const CHAPTERS_1:int = 2;
|
||||
|
||||
public static const SKILLS_1:int = 3;
|
||||
|
||||
public static const GUNS_1:int = 4;
|
||||
|
||||
public static const CLIMB_1:int = 5;
|
||||
|
||||
public static const HEARTCRYSTAL_1:int = 6;
|
||||
|
||||
public static const REDDIAMONDS_1:int = 7;
|
||||
|
||||
public static const BULLETS:int = 8;
|
||||
|
||||
public static const POWERUP_1:int = 9;
|
||||
|
||||
public static const DIAMONDS_2:int = 10;
|
||||
|
||||
public static const LAVADEATH:int = 11;
|
||||
|
||||
public static const BOXES_1:int = 12;
|
||||
|
||||
public static const POTS_1:int = 13;
|
||||
|
||||
public static const CHECKPOINTS:int = 14;
|
||||
|
||||
public static const DIAMONDS_3:int = 15;
|
||||
|
||||
public static const CLIMB_2:int = 16;
|
||||
|
||||
public static const HEARTCRYSTAL_2:int = 17;
|
||||
|
||||
public static const CHAPTERS_2:int = 18;
|
||||
|
||||
public static const ENEMIES_2:int = 19;
|
||||
|
||||
public static const SKILLS_2:int = 20;
|
||||
|
||||
public static const GUNS_2:int = 21;
|
||||
|
||||
public static const REDDIAMONDS_2:int = 22;
|
||||
|
||||
public static const RUNMODE:int = 23;
|
||||
|
||||
public static const CHAPTER1SPEED:int = 24;
|
||||
|
||||
public static const CHAPTER2SPEED:int = 25;
|
||||
|
||||
public static const CHAPTER1PACIFIST:int = 26;
|
||||
|
||||
public static const SNAILIMMUNE:int = 27;
|
||||
|
||||
public static const CH4MISSILEONLY:int = 28;
|
||||
|
||||
public static const BOSSRUSH:int = 29;
|
||||
|
||||
public static const DIAMONDS_4:int = 30;
|
||||
|
||||
public static const CLIMB_3:int = 31;
|
||||
|
||||
public static const CHAPTERS_3:int = 32;
|
||||
|
||||
public static const ENEMIES_3:int = 33;
|
||||
|
||||
public static const SKILLS_3:int = 34;
|
||||
|
||||
public static const GUNS_3:int = 35;
|
||||
|
||||
public static const REDDIAMONDS_3:int = 36;
|
||||
|
||||
public static const TADPOLEMODE:int = 37;
|
||||
|
||||
public static const GOLDBIRDS:int = 38;
|
||||
|
||||
public static const CLIMB_4:int = 39;
|
||||
|
||||
public static const CLIMB_5:int = 40;
|
||||
|
||||
public static const SKILLSGUNS_4:int = 41;
|
||||
|
||||
public static const HEARTCRYSTAL_3:int = 42;
|
||||
|
||||
public static const REDDIAMONDS_4:int = 43;
|
||||
|
||||
public static const HEROICRUSH:int = 44;
|
||||
|
||||
public var id:int;
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var description:String;
|
||||
|
||||
public var type:int;
|
||||
|
||||
public function Achievement(param1:int, param2:int, param3:String, param4:String)
|
||||
{
|
||||
super();
|
||||
this.id = param2;
|
||||
this.name = param3;
|
||||
this.description = param4;
|
||||
this.type = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,359 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import com.arc.dh.state.Trophy;
|
||||
|
||||
public class AchievementSystem
|
||||
{
|
||||
|
||||
public static var achievementWindow:AchievementWindow;
|
||||
|
||||
public static var achievements:Array = new Array();
|
||||
|
||||
achievements[Achievement.DIAMONDS_1] = new Achievement(Trophy.BRONZE,Achievement.DIAMONDS_1,"All Your Diamonds Are Belong To Us","Collect 100 diamonds");
|
||||
achievements[Achievement.ENEMIES_1] = new Achievement(Trophy.BRONZE,Achievement.ENEMIES_1,"Will They Blend?","Defeat 50 enemies");
|
||||
achievements[Achievement.CHAPTERS_1] = new Achievement(Trophy.BRONZE,Achievement.CHAPTERS_1,"The First Of Many","Complete chapter 1 of story mode");
|
||||
achievements[Achievement.SKILLS_1] = new Achievement(Trophy.BRONZE,Achievement.SKILLS_1,"Dunning-Kruger Effect","Buy 5 character upgrades");
|
||||
achievements[Achievement.GUNS_1] = new Achievement(Trophy.BRONZE,Achievement.GUNS_1,"Boom Headshot!","Buy 5 gun upgrades");
|
||||
achievements[Achievement.CLIMB_1] = new Achievement(Trophy.BRONZE,Achievement.CLIMB_1,"I\'m Going To Space","Climb 100m in Escape Mode");
|
||||
achievements[Achievement.HEARTCRYSTAL_1] = new Achievement(Trophy.BRONZE,Achievement.HEARTCRYSTAL_1,"At Least You Don\'t Need Four","Collect a heart crystal");
|
||||
achievements[Achievement.REDDIAMONDS_1] = new Achievement(Trophy.BRONZE,Achievement.REDDIAMONDS_1,"Double Diamond All The Way","Collect 2 red diamonds");
|
||||
achievements[Achievement.BULLETS] = new Achievement(Trophy.BRONZE,Achievement.BULLETS,"Nuke It From Orbit","Shoot 20,000 bullets");
|
||||
achievements[Achievement.POWERUP_1] = new Achievement(Trophy.BRONZE,Achievement.POWERUP_1,"Happy Explosion Day, Gorgeous","Activate 50 powerups");
|
||||
achievements[Achievement.LAVADEATH] = new Achievement(Trophy.BRONZE,Achievement.LAVADEATH,"You Dun Goofed","Fall in the lava in Escape Mode");
|
||||
achievements[Achievement.DIAMONDS_2] = new Achievement(Trophy.BRONZE,Achievement.DIAMONDS_2,"This Is Sparta","Collect 300 diamonds");
|
||||
achievements[Achievement.BOXES_1] = new Achievement(Trophy.BRONZE,Achievement.BOXES_1,"Amazon won\'t be happy","Destroy 1,000 boxes");
|
||||
achievements[Achievement.POTS_1] = new Achievement(Trophy.BRONZE,Achievement.POTS_1,"Pots? In my cave?","Destroy 300 clay pots.");
|
||||
achievements[Achievement.CHECKPOINTS] = new Achievement(Trophy.BRONZE,Achievement.CHECKPOINTS,"Can Has Checkpoints","Buy all 5 checkpoints in Escape Mode");
|
||||
achievements[Achievement.DIAMONDS_3] = new Achievement(Trophy.SILVER,Achievement.DIAMONDS_3,"Push Button, Receive Diamond","Collect 2,000 diamonds");
|
||||
achievements[Achievement.CLIMB_2] = new Achievement(Trophy.SILVER,Achievement.CLIMB_2,"Gonna Be In Space","Climb 500m in Escape Mode");
|
||||
achievements[Achievement.HEARTCRYSTAL_2] = new Achievement(Trophy.SILVER,Achievement.HEARTCRYSTAL_2,"Not Quite An Arc Reactor","Collect 6 heart crystals");
|
||||
achievements[Achievement.CHAPTERS_2] = new Achievement(Trophy.SILVER,Achievement.CHAPTERS_2,"Meanwhile In Chapter 4","Complete Chapter 4");
|
||||
achievements[Achievement.ENEMIES_2] = new Achievement(Trophy.SILVER,Achievement.ENEMIES_2,"Slimes On A Plane","Defeat 200 enemies");
|
||||
achievements[Achievement.SKILLS_2] = new Achievement(Trophy.SILVER,Achievement.SKILLS_2,"Upgrayedd","Buy 20 character upgrades");
|
||||
achievements[Achievement.GUNS_2] = new Achievement(Trophy.SILVER,Achievement.GUNS_2,"Gonna Need A Bigger Gun","Buy 25 gun upgrades");
|
||||
achievements[Achievement.REDDIAMONDS_2] = new Achievement(Trophy.SILVER,Achievement.REDDIAMONDS_2,"Red Diamonds Are Forever","Collect 10 red diamonds");
|
||||
achievements[Achievement.RUNMODE] = new Achievement(Trophy.SILVER,Achievement.RUNMODE,"Can I Bolt?","Reach 2000m in the runner minigame mode");
|
||||
achievements[Achievement.CHAPTER1SPEED] = new Achievement(Trophy.SILVER,Achievement.CHAPTER1SPEED,"Leeeroooyyyy Jeennkkiinnsss","Complete chapter 1 in under 1 minute 50 seconds");
|
||||
achievements[Achievement.CHAPTER2SPEED] = new Achievement(Trophy.SILVER,Achievement.CHAPTER2SPEED,"Sequence Breaker","Complete chapter 2 in under 2 minutes 10 seconds");
|
||||
achievements[Achievement.CHAPTER1PACIFIST] = new Achievement(Trophy.SILVER,Achievement.CHAPTER1PACIFIST,"The First Amendment","Reach the Giant Slime\'s room at the end of chapter 1 without killing a single enemy");
|
||||
achievements[Achievement.SNAILIMMUNE] = new Achievement(Trophy.SILVER,Achievement.SNAILIMMUNE,"Do A Barrel Roll!","Defeat the Snail King in Normal Boss Rush or Practice Boss Rush without taking any damage");
|
||||
achievements[Achievement.CH4MISSILEONLY] = new Achievement(Trophy.SILVER,Achievement.CH4MISSILEONLY,"Forever Alone","Complete chapter 4 using only the missile gun");
|
||||
achievements[Achievement.BOSSRUSH] = new Achievement(Trophy.SILVER,Achievement.BOSSRUSH,"Practice Makes Perfect","Complete Normal Boss Rush");
|
||||
achievements[Achievement.DIAMONDS_4] = new Achievement(Trophy.GOLD,Achievement.DIAMONDS_4,"It\'s Over 9000!","Collect 10,000 diamonds");
|
||||
achievements[Achievement.CLIMB_3] = new Achievement(Trophy.GOLD,Achievement.CLIMB_3,"Here Come The Space Cops","Climb 1000m in Escape Mode");
|
||||
achievements[Achievement.CHAPTERS_3] = new Achievement(Trophy.GOLD,Achievement.CHAPTERS_3,"The Ultimate Showdown","Defeat the Professor in Chapter 7");
|
||||
achievements[Achievement.ENEMIES_3] = new Achievement(Trophy.GOLD,Achievement.ENEMIES_3,"Killers Gonna Kill","Defeat 750 enemies");
|
||||
achievements[Achievement.SKILLS_3] = new Achievement(Trophy.GOLD,Achievement.SKILLS_3,"Which Skill Will I Take?","Buy 40 character upgrades");
|
||||
achievements[Achievement.GUNS_3] = new Achievement(Trophy.GOLD,Achievement.GUNS_3,"Locked And Loaded","Buy 50 gun upgrades");
|
||||
achievements[Achievement.REDDIAMONDS_3] = new Achievement(Trophy.GOLD,Achievement.REDDIAMONDS_3,"Rubies?","Collect 20 red diamonds");
|
||||
achievements[Achievement.TADPOLEMODE] = new Achievement(Trophy.GOLD,Achievement.TADPOLEMODE,"Just Keep Swimming","Reach 800m in the tadpole minigame mode");
|
||||
achievements[Achievement.GOLDBIRDS] = new Achievement(Trophy.GOLD,Achievement.GOLDBIRDS,"Bird! Bird! Bird! It\'s evil!","Have 10 golden birds alive at the same time while fighting the Stone Bird in Boss Rush");
|
||||
achievements[Achievement.CLIMB_4] = new Achievement(Trophy.GOLD,Achievement.CLIMB_4,"I\'m The Best At Space","Climb 1500m in Escape Mode");
|
||||
achievements[Achievement.CLIMB_5] = new Achievement(Trophy.PLATINUM,Achievement.CLIMB_5,"Fact: Space Does Not Exist","Climb 2,000 meters in Escape Mode\n\nNot required for 100% completion");
|
||||
achievements[Achievement.SKILLSGUNS_4] = new Achievement(Trophy.PLATINUM,Achievement.SKILLSGUNS_4,"Upgrade Complete","Buy all gun and\ncharacter upgrades\n\nNot required for 100% completion");
|
||||
achievements[Achievement.HEARTCRYSTAL_3] = new Achievement(Trophy.PLATINUM,Achievement.HEARTCRYSTAL_3,"The Hunt For Red October","Find all 17 heart crystals\n\nNot required for 100% completion");
|
||||
achievements[Achievement.REDDIAMONDS_4] = new Achievement(Trophy.PLATINUM,Achievement.REDDIAMONDS_4,"The Tickets Are Now Diamonds","Collect all 35 red\ndiamonds\n\nNot required for 100% completion");
|
||||
achievements[Achievement.HEROICRUSH] = new Achievement(Trophy.PLATINUM,Achievement.HEROICRUSH,"Herobrine","Complete Heroic Boss Rush\n\nNot required for 100% completion");
|
||||
|
||||
public function AchievementSystem()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get(param1:int) : Achievement
|
||||
{
|
||||
return achievements[param1];
|
||||
}
|
||||
|
||||
public static function achieve(param1:int) : void
|
||||
{
|
||||
if(Data.achievements[param1] == 0)
|
||||
{
|
||||
Data.achievements[param1] = 1;
|
||||
achievementWindow = new AchievementWindow(get(param1).name.toUpperCase());
|
||||
SoundSystem.play(Sound.ACHIEVEMENT);
|
||||
}
|
||||
}
|
||||
|
||||
public static function checkpoints() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < Data.escape.length)
|
||||
{
|
||||
_loc1_ += Data.escape[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
if(_loc1_ >= 6)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHECKPOINTS);
|
||||
}
|
||||
}
|
||||
|
||||
public static function lava() : void
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.LAVADEATH);
|
||||
}
|
||||
|
||||
public static function powerups() : void
|
||||
{
|
||||
if(Data.powerups >= 50)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.POWERUP_1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function heartcrystal() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < Data.heartcrystals.length)
|
||||
{
|
||||
_loc1_ += Data.heartcrystals[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
if(_loc1_ >= 1)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.HEARTCRYSTAL_1);
|
||||
}
|
||||
if(_loc1_ >= 6)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.HEARTCRYSTAL_2);
|
||||
}
|
||||
if(_loc1_ >= 17)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.HEARTCRYSTAL_3);
|
||||
}
|
||||
}
|
||||
|
||||
public static function bullets() : void
|
||||
{
|
||||
if(Data.bullets >= 20000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.BULLETS);
|
||||
}
|
||||
}
|
||||
|
||||
public static function runmode(param1:int) : void
|
||||
{
|
||||
if(param1 > 2000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.RUNMODE);
|
||||
}
|
||||
}
|
||||
|
||||
public static function tadpolemode(param1:int) : void
|
||||
{
|
||||
if(param1 > 800)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.TADPOLEMODE);
|
||||
}
|
||||
}
|
||||
|
||||
public static function boxes() : void
|
||||
{
|
||||
if(Data.boxes >= 1000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.BOXES_1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function pots() : void
|
||||
{
|
||||
if(Data.pots >= 300)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.POTS_1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function climb(param1:int) : void
|
||||
{
|
||||
if(param1 >= 100)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CLIMB_1);
|
||||
}
|
||||
if(param1 >= 500)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CLIMB_2);
|
||||
}
|
||||
if(param1 >= 1000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CLIMB_3);
|
||||
}
|
||||
if(param1 >= 1500)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CLIMB_4);
|
||||
}
|
||||
if(param1 >= 2000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CLIMB_5);
|
||||
}
|
||||
}
|
||||
|
||||
public static function skills() : void
|
||||
{
|
||||
if(Data.upgrades >= 5)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.SKILLS_1);
|
||||
}
|
||||
if(Data.upgrades >= 20)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.SKILLS_2);
|
||||
}
|
||||
if(Data.upgrades >= 40)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.SKILLS_3);
|
||||
}
|
||||
upgrades();
|
||||
}
|
||||
|
||||
public static function guns() : void
|
||||
{
|
||||
if(Data.guns >= 5)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.GUNS_1);
|
||||
}
|
||||
if(Data.guns >= 25)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.GUNS_2);
|
||||
}
|
||||
if(Data.guns >= 50)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.GUNS_3);
|
||||
}
|
||||
upgrades();
|
||||
}
|
||||
|
||||
public static function upgrades() : void
|
||||
{
|
||||
if(Data.guns >= 88 && Data.upgrades >= 60)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.SKILLSGUNS_4);
|
||||
}
|
||||
}
|
||||
|
||||
public static function enemies() : void
|
||||
{
|
||||
if(Data.enemies >= 50)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.ENEMIES_1);
|
||||
}
|
||||
if(Data.enemies >= 200)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.ENEMIES_2);
|
||||
}
|
||||
if(Data.enemies >= 750)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.ENEMIES_3);
|
||||
}
|
||||
}
|
||||
|
||||
public static function diamonds() : void
|
||||
{
|
||||
if(Data.totaldiamonds >= 100)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.DIAMONDS_1);
|
||||
}
|
||||
if(Data.totaldiamonds >= 300)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.DIAMONDS_2);
|
||||
}
|
||||
if(Data.totaldiamonds >= 2000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.DIAMONDS_3);
|
||||
}
|
||||
if(Data.totaldiamonds >= 10000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.DIAMONDS_4);
|
||||
}
|
||||
}
|
||||
|
||||
public static function reddiamonds() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < Data.redDiamonds.length)
|
||||
{
|
||||
_loc1_ += Data.redDiamonds[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
if(_loc1_ >= 2)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.REDDIAMONDS_1);
|
||||
}
|
||||
if(_loc1_ >= 10)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.REDDIAMONDS_2);
|
||||
}
|
||||
if(_loc1_ >= 20)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.REDDIAMONDS_3);
|
||||
}
|
||||
if(_loc1_ >= 35)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.REDDIAMONDS_4);
|
||||
}
|
||||
}
|
||||
|
||||
public static function completeChapter(param1:int, param2:int, param3:int) : void
|
||||
{
|
||||
if(param1 == 1)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTERS_1);
|
||||
}
|
||||
if(param1 == 4)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTERS_2);
|
||||
}
|
||||
if(param1 == 7)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTERS_3);
|
||||
}
|
||||
if(param1 == 1 && param2 <= 110000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTER1SPEED);
|
||||
}
|
||||
if(param1 == 2 && param2 <= 130000)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTER2SPEED);
|
||||
}
|
||||
}
|
||||
|
||||
public static function reachBoss(param1:int, param2:int) : void
|
||||
{
|
||||
if(param2 == 0 && param1 == 1)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CHAPTER1PACIFIST);
|
||||
}
|
||||
}
|
||||
|
||||
public static function snailimmune() : void
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.SNAILIMMUNE);
|
||||
}
|
||||
|
||||
public static function birds(param1:int) : void
|
||||
{
|
||||
if(param1 >= 10)
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.GOLDBIRDS);
|
||||
}
|
||||
}
|
||||
|
||||
public static function bossRush() : void
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.BOSSRUSH);
|
||||
}
|
||||
|
||||
public static function bossRushHeroic() : void
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.HEROICRUSH);
|
||||
}
|
||||
|
||||
public static function nonMissile() : void
|
||||
{
|
||||
AchievementSystem.achieve(Achievement.CH4MISSILEONLY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
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 AchievementWindow extends ArcGroup
|
||||
{
|
||||
|
||||
private static const sprite:Class = AchievementWindow_sprite;
|
||||
|
||||
public var bg:ArcSprite;
|
||||
|
||||
public var text:FlxBitmapText;
|
||||
|
||||
public var timer:Number = 2;
|
||||
|
||||
public function AchievementWindow(param1:String = "SPAAAAAAAAAAAAACE")
|
||||
{
|
||||
super();
|
||||
var _loc2_:int = 80;
|
||||
var _loc3_:int = 200;
|
||||
this.bg = new ArcSprite(_loc2_,_loc3_,sprite);
|
||||
this.add(this.bg);
|
||||
this.text = new FlxBitmapText(_loc2_ + 3,_loc3_ + 18,Fonts.font(Fonts.SMALL_WHITE),param1,"center",199);
|
||||
this.add(this.text);
|
||||
if(TextSystem.active())
|
||||
{
|
||||
this.bg.y = 176;
|
||||
this.text.y = this.bg.y + 18;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bg.y = 200;
|
||||
this.text.y = this.bg.y + 18;
|
||||
}
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
this.bg.alpha = alpha;
|
||||
this.text.alpha = alpha;
|
||||
if(TextSystem.active())
|
||||
{
|
||||
this.bg.y = 176;
|
||||
this.text.y = this.bg.y + 18;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bg.y = 200;
|
||||
this.text.y = this.bg.y + 18;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/228_com.arc.dh.util.AchievementWindow_sprite.png")]
|
||||
public class AchievementWindow_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function AchievementWindow_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
|
||||
public static const DEBUG:Boolean = false;
|
||||
|
||||
public static const KONGREGATE:String = "Kongregate";
|
||||
|
||||
public static const ARMORGAMES:String = "Armor Games";
|
||||
|
||||
public static const FLASHGAMELICENSE:String = "FGL";
|
||||
|
||||
public static const PERSONAL:String = "Personal";
|
||||
|
||||
public static const DISTRIBUTION:String = "Distribution";
|
||||
|
||||
public static const MAXGAMES:String = "MaxGames";
|
||||
|
||||
public static const PEGAS:String = "Pegas Games";
|
||||
|
||||
public static const BLOCK_SIZE:int = 12;
|
||||
|
||||
public static const WIDTH:int = 360;
|
||||
|
||||
public static const HEIGHT:int = 240;
|
||||
|
||||
public static const BLOCK_WIDTH:int = WIDTH / BLOCK_SIZE;
|
||||
|
||||
public static const BLOCK_HEIGHT:int = HEIGHT / BLOCK_SIZE;
|
||||
|
||||
public static const RELEASE:String = PEGAS;
|
||||
|
||||
public static const VERSION:String = "1.21";
|
||||
|
||||
public static const SPAWN_PADDING:int = 6;
|
||||
|
||||
public static const DESPAWN_PADDING:int = 12;
|
||||
|
||||
public function Config()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getSiteLock() : String
|
||||
{
|
||||
switch(RELEASE)
|
||||
{
|
||||
case KONGREGATE:
|
||||
return "kongregate.com";
|
||||
case ARMORGAMES:
|
||||
return "armorgames.com";
|
||||
case FLASHGAMELICENSE:
|
||||
return "flashgamelicense.com";
|
||||
case PERSONAL:
|
||||
return "iarke.us";
|
||||
case DISTRIBUTION:
|
||||
return "";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function externalAPIs() : Boolean
|
||||
{
|
||||
if(RELEASE == ARMORGAMES)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import com.arc.dh.Gun;
|
||||
import com.arc.dh.state.FlxKongregate;
|
||||
import com.arc.dh.state.PlayMode;
|
||||
|
||||
public class Data
|
||||
{
|
||||
|
||||
public static var state:PlayMode;
|
||||
|
||||
public static const DEBUG:Boolean = false;
|
||||
|
||||
private static var _hpm:int = 3;
|
||||
|
||||
public static var vitality:int = 0;
|
||||
|
||||
public static var hp:int = hpm;
|
||||
|
||||
public static var heartcrystals:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
|
||||
public static var diamonds:int = 0;
|
||||
|
||||
public static var totaldiamonds:int = 0;
|
||||
|
||||
public static var agility:int = 0;
|
||||
|
||||
public static var jump:int = 0;
|
||||
|
||||
public static var attract:int = 0;
|
||||
|
||||
public static var recover:int = 0;
|
||||
|
||||
public static var aegis:int = 0;
|
||||
|
||||
public static var defense:int = 0;
|
||||
|
||||
public static var primegun:Array = [0,0,0,0];
|
||||
|
||||
public static var spreadergun:Array = [0,0,0,0];
|
||||
|
||||
public static var missilegun:Array = [0,0,0,0];
|
||||
|
||||
public static var reboundgun:Array = [0,0,0,0];
|
||||
|
||||
public static var prime:int = 0;
|
||||
|
||||
public static var spreader:int = 0;
|
||||
|
||||
public static var missile:int = 0;
|
||||
|
||||
public static var rebound:int = 0;
|
||||
|
||||
public static var autofirer:int = 0;
|
||||
|
||||
public static var lasersight:int = 0;
|
||||
|
||||
public static var skyboots:int = 0;
|
||||
|
||||
public static var moltensuit:int = 0;
|
||||
|
||||
public static var moonboots:int = 0;
|
||||
|
||||
public static var xrayscope:int = 0;
|
||||
|
||||
public static var gun:String = Gun.PRIME;
|
||||
|
||||
public static var maxheight:int = 0;
|
||||
|
||||
public static var enemies:int = 0;
|
||||
|
||||
public static var deaths:int = 0;
|
||||
|
||||
public static var bullets:int = 0;
|
||||
|
||||
public static var time:Number = 0;
|
||||
|
||||
public static var ctime:Number = 0;
|
||||
|
||||
public static var boxes:int = 0;
|
||||
|
||||
public static var pots:int = 0;
|
||||
|
||||
public static var powerups:int = 0;
|
||||
|
||||
public static var maxRunDistance:int = 0;
|
||||
|
||||
public static var maxTadpoleDistance:int = 0;
|
||||
|
||||
public static const CONTROL_MOUSE:int = 0;
|
||||
|
||||
public static const CONTROL_KEYBOARD:int = 1;
|
||||
|
||||
public static const CONTROL_KEYBOARDI:int = 2;
|
||||
|
||||
public static var control:int = CONTROL_MOUSE;
|
||||
|
||||
public static const SPEED_SLOW:int = 0;
|
||||
|
||||
public static const SPEED_MED:int = 1;
|
||||
|
||||
public static const SPEED_FAST:int = 2;
|
||||
|
||||
public static var textspeed:int = SPEED_MED;
|
||||
|
||||
public static const ON:int = 0;
|
||||
|
||||
public static const OFF:int = 1;
|
||||
|
||||
public static var sound:int = ON;
|
||||
|
||||
public static var music:int = ON;
|
||||
|
||||
public static var escape:Array = [1,0,0,0,0,0];
|
||||
|
||||
public static var boss:Array = [0,0,0,0];
|
||||
|
||||
public static var redDiamonds:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
|
||||
public static var chapters:Array = [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]];
|
||||
|
||||
public static var achievements:Array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
|
||||
public static var autofire:Boolean = false;
|
||||
|
||||
public static const GAMEID:int = 4357;
|
||||
|
||||
public static const GUID:String = "04f5a410aedc4d46";
|
||||
|
||||
public static const API_KEY:String = "55d1b5c4fb01405883aab993346490";
|
||||
|
||||
if(DEBUG)
|
||||
{
|
||||
agility = jump = attract = recover = aegis = defense = 10;
|
||||
primegun = [10,10,1,1];
|
||||
prime = 1;
|
||||
chapters = [[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]];
|
||||
boss = [1,1,0,0];
|
||||
vitality = 17;
|
||||
moonboots = 1;
|
||||
skyboots = 1;
|
||||
}
|
||||
|
||||
public function Data()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function get completion() : String
|
||||
{
|
||||
var _loc1_:Number = 0;
|
||||
var _loc2_:Number = 0;
|
||||
_loc1_ += getAchievementCount(false);
|
||||
_loc2_ += 40;
|
||||
_loc1_ += upgrades;
|
||||
_loc2_ += 60;
|
||||
_loc1_ += guns;
|
||||
_loc2_ += 88;
|
||||
_loc1_ += vitality * 2;
|
||||
_loc2_ += 17 * 2;
|
||||
_loc1_ += chapterCount * 3;
|
||||
_loc2_ += 7 * 3;
|
||||
_loc1_ += redDiamondCount * 2;
|
||||
_loc2_ += 35 * 2;
|
||||
return (_loc1_ / _loc2_ * 100).toFixed(2);
|
||||
}
|
||||
|
||||
public static function get redDiamondCount() : int
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < redDiamonds.length)
|
||||
{
|
||||
_loc1_ += redDiamonds[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
return _loc1_;
|
||||
}
|
||||
|
||||
public static function get chapterCount() : int
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < chapters.length)
|
||||
{
|
||||
_loc1_ += chapters[_loc2_][0] > 0 ? 1 : 0;
|
||||
_loc2_++;
|
||||
}
|
||||
return _loc1_;
|
||||
}
|
||||
|
||||
public static function get upgrades() : int
|
||||
{
|
||||
return agility + jump + attract + recover + aegis + defense;
|
||||
}
|
||||
|
||||
public static function get guns() : int
|
||||
{
|
||||
return primegun[0] + primegun[1] + primegun[2] + primegun[3] + spreadergun[0] + spreadergun[1] + spreadergun[2] + spreadergun[3] + missilegun[0] + missilegun[1] + missilegun[2] + missilegun[3] + reboundgun[0] + reboundgun[1] + reboundgun[2] + reboundgun[3];
|
||||
}
|
||||
|
||||
public static function getAchievementCount(param1:Boolean = true) : int
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:int = 0;
|
||||
while(_loc3_ < achievements.length)
|
||||
{
|
||||
if(param1 || _loc3_ < 40)
|
||||
{
|
||||
_loc2_ += achievements[_loc3_];
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public static function get hpm() : int
|
||||
{
|
||||
return _hpm + vitality;
|
||||
}
|
||||
|
||||
public static function duration(param1:int, param2:int) : String
|
||||
{
|
||||
var _loc3_:int = (param2 - param1) / 1000;
|
||||
var _loc4_:Number = _loc3_ % 60;
|
||||
_loc3_ /= 60;
|
||||
var _loc5_:Number = _loc3_ % 60;
|
||||
_loc3_ /= 60;
|
||||
var _loc6_:Number = _loc3_;
|
||||
return (_loc6_ < 10 ? "0" + _loc6_ : _loc6_.toString()) + ":" + (_loc5_ < 10 ? "0" + _loc5_ : _loc5_.toString()) + ":" + (_loc4_ < 10 ? "0" + _loc4_ : _loc4_.toString());
|
||||
}
|
||||
|
||||
public static function hasRed(param1:int, param2:int) : Boolean
|
||||
{
|
||||
return redDiamonds[(param1 - 1) * 5 + param2] == 1;
|
||||
}
|
||||
|
||||
public static function obtainRed(param1:int, param2:int) : void
|
||||
{
|
||||
redDiamonds[(param1 - 1) * 5 + param2] = 1;
|
||||
}
|
||||
|
||||
public static function reset() : void
|
||||
{
|
||||
vitality = 0;
|
||||
hp = hpm;
|
||||
heartcrystals = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
diamonds = 0;
|
||||
totaldiamonds = 0;
|
||||
agility = 0;
|
||||
jump = 0;
|
||||
attract = 0;
|
||||
recover = 0;
|
||||
aegis = 0;
|
||||
defense = 0;
|
||||
primegun = [0,0,0,0];
|
||||
spreadergun = [0,0,0,0];
|
||||
missilegun = [0,0,0,0];
|
||||
reboundgun = [0,0,0,0];
|
||||
prime = 0;
|
||||
spreader = 0;
|
||||
missile = 0;
|
||||
rebound = 0;
|
||||
autofirer = 0;
|
||||
lasersight = 0;
|
||||
skyboots = 0;
|
||||
moltensuit = 0;
|
||||
moonboots = 0;
|
||||
xrayscope = 0;
|
||||
maxheight = 0;
|
||||
enemies = 0;
|
||||
deaths = 0;
|
||||
bullets = 0;
|
||||
time = 0;
|
||||
ctime = 0;
|
||||
boxes = 0;
|
||||
pots = 0;
|
||||
powerups = 0;
|
||||
control = CONTROL_MOUSE;
|
||||
textspeed = SPEED_MED;
|
||||
sound = ON;
|
||||
music = ON;
|
||||
escape = [1,0,0,0,0,0];
|
||||
boss = [0,0,0,0];
|
||||
maxRunDistance = 0;
|
||||
maxTadpoleDistance = 0;
|
||||
redDiamonds = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
chapters = [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]];
|
||||
achievements = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||
autofire = false;
|
||||
}
|
||||
|
||||
public static function kong() : void
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
if(!Config.externalAPIs())
|
||||
{
|
||||
return;
|
||||
}
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < 7)
|
||||
{
|
||||
if(Data.chapters[_loc2_][0] > 0)
|
||||
{
|
||||
_loc1_ = _loc2_ + 1;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
FlxKongregate.submitStats("chapters_complete",_loc1_);
|
||||
FlxKongregate.submitStats("escape_height",Data.maxheight);
|
||||
FlxKongregate.submitStats("run_distance",Data.maxRunDistance);
|
||||
FlxKongregate.submitStats("tadpole_distance",Data.maxTadpoleDistance);
|
||||
FlxKongregate.submitStats("enemies_killed",Data.enemies);
|
||||
_loc1_ = 0;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < Data.heartcrystals.length)
|
||||
{
|
||||
_loc1_ += Data.heartcrystals[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
FlxKongregate.submitStats("heart_crystals",_loc1_);
|
||||
FlxKongregate.submitStats("num_upgrades",Data.guns + Data.upgrades);
|
||||
FlxKongregate.submitStats("total_diamonds",Data.totaldiamonds);
|
||||
_loc1_ = 0;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < Data.redDiamonds.length)
|
||||
{
|
||||
_loc1_ += Data.redDiamonds[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
FlxKongregate.submitStats("red_diamonds",_loc1_);
|
||||
var _loc3_:int = Math.floor(parseFloat(Data.completion));
|
||||
FlxKongregate.submitStats("completion_percent_v2",_loc3_);
|
||||
var _loc4_:int = (Data.boss[1] as int) / 1000;
|
||||
var _loc5_:int = (Data.boss[3] as int) / 1000;
|
||||
FlxKongregate.submitStats("normal_boss_time_v2",_loc4_ > 0 ? _loc4_ : 9999);
|
||||
FlxKongregate.submitStats("heroic_boss_time_v2",_loc5_ > 0 ? _loc5_ : 9999);
|
||||
_loc1_ = 0;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < Data.chapters.length)
|
||||
{
|
||||
_loc6_ = Data.chapters[_loc2_][1] / 1000;
|
||||
if(_loc6_ > 0)
|
||||
{
|
||||
_loc1_ += _loc6_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc1_ += 9999;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
FlxKongregate.submitStats("chapter_speed",_loc1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import com.hurlant.crypto.symmetric.BlowFishKey;
|
||||
import com.hurlant.crypto.symmetric.ECBMode;
|
||||
import com.hurlant.crypto.symmetric.ICipher;
|
||||
import com.hurlant.crypto.symmetric.IPad;
|
||||
import com.hurlant.crypto.symmetric.PKCS5;
|
||||
import com.hurlant.util.Base64;
|
||||
import com.hurlant.util.Hex;
|
||||
import flash.net.SharedObject;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class DataSerializer
|
||||
{
|
||||
|
||||
private static var state:Array;
|
||||
|
||||
private static var key:String = "diamond_hollow_2";
|
||||
|
||||
public function DataSerializer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function reset() : void
|
||||
{
|
||||
Data.reset();
|
||||
save();
|
||||
}
|
||||
|
||||
public static function save() : void
|
||||
{
|
||||
var so:SharedObject = null;
|
||||
var encrypted:String = null;
|
||||
try
|
||||
{
|
||||
so = SharedObject.getLocal("diamondhollow2");
|
||||
encrypted = encrypt(serialize());
|
||||
if(encrypted != null)
|
||||
{
|
||||
so.data.save = encrypted;
|
||||
}
|
||||
so.flush();
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static function load() : void
|
||||
{
|
||||
var so:SharedObject = null;
|
||||
var unencrypted:String = null;
|
||||
try
|
||||
{
|
||||
so = SharedObject.getLocal("diamondhollow2");
|
||||
if(so != null && so.data != null && so.data.save != null)
|
||||
{
|
||||
unencrypted = decrypt(so.data.save);
|
||||
if(unencrypted != null)
|
||||
{
|
||||
unserialize(unencrypted);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static function serialize() : String
|
||||
{
|
||||
state = [];
|
||||
write(Data.vitality);
|
||||
write(Data.heartcrystals);
|
||||
write(Data.diamonds);
|
||||
write(Data.totaldiamonds);
|
||||
write(Data.agility);
|
||||
write(Data.jump);
|
||||
write(Data.attract);
|
||||
write(Data.recover);
|
||||
write(Data.aegis);
|
||||
write(Data.defense);
|
||||
write(Data.primegun);
|
||||
write(Data.spreadergun);
|
||||
write(Data.missilegun);
|
||||
write(Data.reboundgun);
|
||||
write(Data.prime);
|
||||
write(Data.spreader);
|
||||
write(Data.missile);
|
||||
write(Data.rebound);
|
||||
write(Data.autofirer);
|
||||
write(Data.lasersight);
|
||||
write(Data.skyboots);
|
||||
write(Data.moltensuit);
|
||||
write(Data.moonboots);
|
||||
write(Data.xrayscope);
|
||||
write(Data.maxheight);
|
||||
write(Data.enemies);
|
||||
write(Data.deaths);
|
||||
write(Data.bullets);
|
||||
write(Data.time);
|
||||
write(Data.boxes);
|
||||
write(Data.pots);
|
||||
write(Data.powerups);
|
||||
write(Data.control);
|
||||
write(Data.textspeed);
|
||||
write(Data.sound);
|
||||
write(Data.music);
|
||||
write(Data.escape);
|
||||
write(Data.redDiamonds);
|
||||
write(Data.achievements);
|
||||
write(Data.autofire ? 1 : 0);
|
||||
write(Data.chapters);
|
||||
write(Data.boss);
|
||||
write(Data.maxRunDistance);
|
||||
write(Data.maxTadpoleDistance);
|
||||
return state.join(",");
|
||||
}
|
||||
|
||||
public static function unserialize(param1:String) : void
|
||||
{
|
||||
var _loc5_:Array = null;
|
||||
state = param1.split(",");
|
||||
Data.vitality = read(int);
|
||||
Data.heartcrystals = read(Array,17);
|
||||
Data.diamonds = read(int);
|
||||
Data.totaldiamonds = read(int);
|
||||
Data.agility = read(int);
|
||||
Data.jump = read(int);
|
||||
Data.attract = read(int);
|
||||
Data.recover = read(int);
|
||||
Data.aegis = read(int);
|
||||
Data.defense = read(int);
|
||||
Data.primegun = read(Array,4);
|
||||
Data.spreadergun = read(Array,4);
|
||||
Data.missilegun = read(Array,4);
|
||||
Data.reboundgun = read(Array,4);
|
||||
Data.prime = read(int);
|
||||
Data.spreader = read(int);
|
||||
Data.missile = read(int);
|
||||
Data.rebound = read(int);
|
||||
Data.autofirer = read(int);
|
||||
Data.lasersight = read(int);
|
||||
Data.skyboots = read(int);
|
||||
Data.moltensuit = read(int);
|
||||
Data.moonboots = read(int);
|
||||
Data.xrayscope = read(int);
|
||||
Data.maxheight = read(int);
|
||||
Data.enemies = read(int);
|
||||
Data.deaths = read(int);
|
||||
Data.bullets = read(int);
|
||||
Data.time = read(int);
|
||||
Data.boxes = read(int);
|
||||
Data.pots = read(int);
|
||||
Data.powerups = read(int);
|
||||
Data.control = read(int);
|
||||
Data.textspeed = read(int);
|
||||
Data.sound = read(int);
|
||||
Data.music = read(int);
|
||||
Data.escape = read(Array,6);
|
||||
Data.redDiamonds = read(Array,35);
|
||||
Data.achievements = read(Array,45);
|
||||
Data.autofire = read(int) == 1 ? true : false;
|
||||
Data.chapters = new Array();
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < 7)
|
||||
{
|
||||
_loc5_ = read(Array,2);
|
||||
Data.chapters[_loc2_] = _loc5_;
|
||||
_loc2_++;
|
||||
}
|
||||
Data.boss = read(Array,4);
|
||||
Data.maxRunDistance = read(int);
|
||||
Data.maxTadpoleDistance = read(int);
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
while(_loc4_ < 17)
|
||||
{
|
||||
_loc3_ += Data.heartcrystals[_loc4_];
|
||||
_loc4_++;
|
||||
}
|
||||
Data.vitality = _loc3_;
|
||||
}
|
||||
|
||||
public static function write(param1:*) : void
|
||||
{
|
||||
var _loc2_:* = undefined;
|
||||
if(param1 is Array)
|
||||
{
|
||||
for each(_loc2_ in param1)
|
||||
{
|
||||
write(_loc2_);
|
||||
}
|
||||
}
|
||||
else if(param1 is Number || param1 is int || param1 is String)
|
||||
{
|
||||
state.push(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function read(param1:Class, param2:int = 0) : *
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
var _loc4_:int = 0;
|
||||
switch(param1)
|
||||
{
|
||||
case int:
|
||||
return parseInt(state.shift()) as int;
|
||||
case String:
|
||||
return state.shift() as String;
|
||||
case Array:
|
||||
_loc3_ = [];
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < param2)
|
||||
{
|
||||
_loc3_.push(parseInt(state.shift()));
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc3_ as Array;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static function encrypt(param1:String) : String
|
||||
{
|
||||
var output:ByteArray = null;
|
||||
var pad:IPad = null;
|
||||
var cipher:ICipher = null;
|
||||
var data:String = param1;
|
||||
try
|
||||
{
|
||||
output = new ByteArray();
|
||||
output.writeUTFBytes(data);
|
||||
pad = new PKCS5();
|
||||
cipher = _getCipher(key,pad);
|
||||
pad.setBlockSize(cipher.getBlockSize());
|
||||
cipher.encrypt(output);
|
||||
return Base64.encodeByteArray(output);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function decrypt(param1:String) : String
|
||||
{
|
||||
var input:ByteArray = null;
|
||||
var pad:IPad = null;
|
||||
var cipher:ICipher = null;
|
||||
var data:String = param1;
|
||||
try
|
||||
{
|
||||
input = Base64.decodeToByteArray(data);
|
||||
pad = new PKCS5();
|
||||
cipher = _getCipher(key,pad);
|
||||
pad.setBlockSize(cipher.getBlockSize());
|
||||
cipher.decrypt(input);
|
||||
input.position = 0;
|
||||
return input.readUTFBytes(input.length);
|
||||
}
|
||||
catch(error:Error)
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function _getCipher(param1:String, param2:IPad) : ICipher
|
||||
{
|
||||
return new ECBMode(new BlowFishKey(Hex.toArray(Hex.fromString(param1))),param2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import org.flixel.FlxBitmapFont;
|
||||
|
||||
public class Fonts
|
||||
{
|
||||
|
||||
private static var fontSprite:Class = Fonts_fontSprite;
|
||||
|
||||
private static var fontOutlineBlueSprite:Class = Fonts_fontOutlineBlueSprite;
|
||||
|
||||
private static var fontOutlineBlueSSprite:Class = Fonts_fontOutlineBlueSSprite;
|
||||
|
||||
private static var fontOutlineBrownSprite:Class = Fonts_fontOutlineBrownSprite;
|
||||
|
||||
private static var fontOutlineBlackSprite:Class = Fonts_fontOutlineBlackSprite;
|
||||
|
||||
private static var fontOutlineBlackSSprite:Class = Fonts_fontOutlineBlackSSprite;
|
||||
|
||||
private static var fontBevelBlueSprite:Class = Fonts_fontBevelBlueSprite;
|
||||
|
||||
private static var fontBevelGraySprite:Class = Fonts_fontBevelGraySprite;
|
||||
|
||||
private static var fontBevelYellowSprite:Class = Fonts_fontBevelYellowSprite;
|
||||
|
||||
private static var fontOutlineGradientSprite:Class = Fonts_fontOutlineGradientSprite;
|
||||
|
||||
private static var fontOutlineGradientSSprite:Class = Fonts_fontOutlineGradientSSprite;
|
||||
|
||||
public static const SMALL_WHITE:String = "small_white";
|
||||
|
||||
public static const OUTLINE_BLUE:String = "outline_white";
|
||||
|
||||
public static const OUTLINE_BLUE_S:String = "outline_blue_s";
|
||||
|
||||
public static const OUTLINE_BROWN:String = "outline_brown";
|
||||
|
||||
public static const OUTLINE_BLACK:String = "outline_black";
|
||||
|
||||
public static const OUTLINE_BLACK_S:String = "outline_black_s";
|
||||
|
||||
public static const BEVEL_BLUE:String = "bevel_blue";
|
||||
|
||||
public static const BEVEL_GRAY:String = "bevel_gray";
|
||||
|
||||
public static const BEVEL_YELLOW:String = "bevel_yellow";
|
||||
|
||||
public static const OUTLINE_GRADIENT:String = "outline_gradient";
|
||||
|
||||
public static const OUTLINE_GRADIENT_S:String = "outline_gradient_s";
|
||||
|
||||
private static var FONTS:Object = new Object();
|
||||
|
||||
FONTS[SMALL_WHITE] = new FlxBitmapFont(fontSprite,0,7,1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_BROWN] = new FlxBitmapFont(fontOutlineBrownSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_BLUE] = new FlxBitmapFont(fontOutlineBlueSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_BLUE_S] = new FlxBitmapFont(fontOutlineBlueSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_BLACK] = new FlxBitmapFont(fontOutlineBlackSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_BLACK_S] = new FlxBitmapFont(fontOutlineBlackSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[BEVEL_BLUE] = new FlxBitmapFont(fontBevelBlueSprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[BEVEL_GRAY] = new FlxBitmapFont(fontBevelGraySprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[BEVEL_YELLOW] = new FlxBitmapFont(fontBevelYellowSprite,0,9,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_GRADIENT] = new FlxBitmapFont(fontOutlineGradientSprite,0,8,0,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
FONTS[OUTLINE_GRADIENT_S] = new FlxBitmapFont(fontOutlineGradientSSprite,0,8,-1,1," ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=_+[]{};\':\",./<>?~!@#$%^&*()");
|
||||
|
||||
public function Fonts()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function font(param1:String) : FlxBitmapFont
|
||||
{
|
||||
return FONTS[param1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/162_com.arc.dh.util.Fonts_fontBevelBlueSprite.png")]
|
||||
public class Fonts_fontBevelBlueSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontBevelBlueSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/208_com.arc.dh.util.Fonts_fontBevelGraySprite.png")]
|
||||
public class Fonts_fontBevelGraySprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontBevelGraySprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/147_com.arc.dh.util.Fonts_fontBevelYellowSprite.png")]
|
||||
public class Fonts_fontBevelYellowSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontBevelYellowSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/289_com.arc.dh.util.Fonts_fontOutlineBlackSSprite.png")]
|
||||
public class Fonts_fontOutlineBlackSSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineBlackSSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/141_com.arc.dh.util.Fonts_fontOutlineBlackSprite.png")]
|
||||
public class Fonts_fontOutlineBlackSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineBlackSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/237_com.arc.dh.util.Fonts_fontOutlineBlueSSprite.png")]
|
||||
public class Fonts_fontOutlineBlueSSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineBlueSSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/120_com.arc.dh.util.Fonts_fontOutlineBlueSprite.png")]
|
||||
public class Fonts_fontOutlineBlueSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineBlueSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/52_com.arc.dh.util.Fonts_fontOutlineBrownSprite.png")]
|
||||
public class Fonts_fontOutlineBrownSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineBrownSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/77_com.arc.dh.util.Fonts_fontOutlineGradientSSprite.png")]
|
||||
public class Fonts_fontOutlineGradientSSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineGradientSSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/234_com.arc.dh.util.Fonts_fontOutlineGradientSprite.png")]
|
||||
public class Fonts_fontOutlineGradientSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontOutlineGradientSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/148_com.arc.dh.util.Fonts_fontSprite.png")]
|
||||
public class Fonts_fontSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Fonts_fontSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class ParticleSystem
|
||||
{
|
||||
|
||||
public static var p_black:Class = ParticleSystem_p_black;
|
||||
|
||||
public static var p_red:Class = ParticleSystem_p_red;
|
||||
|
||||
public static var p_blue:Class = ParticleSystem_p_blue;
|
||||
|
||||
public static var p_green:Class = ParticleSystem_p_green;
|
||||
|
||||
public static var p_yellow:Class = ParticleSystem_p_yellow;
|
||||
|
||||
public static var p_purple:Class = ParticleSystem_p_purple;
|
||||
|
||||
public static var p_cyan:Class = ParticleSystem_p_cyan;
|
||||
|
||||
public static var p_white:Class = ParticleSystem_p_white;
|
||||
|
||||
public static var p_prime:Class = ParticleSystem_p_prime;
|
||||
|
||||
public static var p_rebound:Class = ParticleSystem_p_rebound;
|
||||
|
||||
public static var p_diamonds:Class = ParticleSystem_p_diamonds;
|
||||
|
||||
public static var p_pot:Class = ParticleSystem_p_pot;
|
||||
|
||||
public static var p_woodenCrate:Class = ParticleSystem_p_woodenCrate;
|
||||
|
||||
public static var p_steelCrate:Class = ParticleSystem_p_steelCrate;
|
||||
|
||||
private static var _initialized:Boolean = false;
|
||||
|
||||
public function ParticleSystem()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function initialize() : void
|
||||
{
|
||||
if(_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ArcParticleSystem.registerEmitter(Color.RED,p_red,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.BLUE,p_blue,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.GREEN,p_green,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.YELLOW,p_yellow,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.PURPLE,p_purple,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.BLACK,p_black,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.CYAN,p_cyan,100,false);
|
||||
ArcParticleSystem.registerEmitter(Color.WHITE,p_white,100,false);
|
||||
ArcParticleSystem.registerEmitter("prime",p_prime,100,true);
|
||||
ArcParticleSystem.registerEmitter("rebound",p_rebound,100,true);
|
||||
ArcParticleSystem.registerEmitter("diamonds",p_diamonds,100,true);
|
||||
ArcParticleSystem.registerEmitter("pot",p_pot,50,true);
|
||||
ArcParticleSystem.registerEmitter("wooden_crate",p_woodenCrate,50,true);
|
||||
ArcParticleSystem.registerEmitter("steel_crate",p_steelCrate,50,true);
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/42_com.arc.dh.util.ParticleSystem_p_black.png")]
|
||||
public class ParticleSystem_p_black extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_black()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/85_com.arc.dh.util.ParticleSystem_p_blue.png")]
|
||||
public class ParticleSystem_p_blue extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_blue()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/79_com.arc.dh.util.ParticleSystem_p_cyan.png")]
|
||||
public class ParticleSystem_p_cyan extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_cyan()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/146.png")]
|
||||
public class ParticleSystem_p_diamonds extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_diamonds()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/220_com.arc.dh.util.ParticleSystem_p_green.png")]
|
||||
public class ParticleSystem_p_green extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_green()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/94_com.arc.dh.util.ParticleSystem_p_pot.png")]
|
||||
public class ParticleSystem_p_pot extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_pot()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/239_com.arc.dh.util.ParticleSystem_p_prime.png")]
|
||||
public class ParticleSystem_p_prime extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_prime()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/299_com.arc.dh.util.ParticleSystem_p_purple.png")]
|
||||
public class ParticleSystem_p_purple extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_purple()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/53_com.arc.dh.util.ParticleSystem_p_rebound.png")]
|
||||
public class ParticleSystem_p_rebound extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_rebound()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/103_com.arc.dh.util.ParticleSystem_p_red.png")]
|
||||
public class ParticleSystem_p_red extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_red()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/271_com.arc.dh.util.ParticleSystem_p_steelCrate.png")]
|
||||
public class ParticleSystem_p_steelCrate extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_steelCrate()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/238_com.arc.dh.util.ParticleSystem_p_white.png")]
|
||||
public class ParticleSystem_p_white extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_white()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/117_com.arc.dh.util.ParticleSystem_p_woodenCrate.png")]
|
||||
public class ParticleSystem_p_woodenCrate extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_woodenCrate()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/227_com.arc.dh.util.ParticleSystem_p_yellow.png")]
|
||||
public class ParticleSystem_p_yellow extends BitmapAsset
|
||||
{
|
||||
|
||||
public function ParticleSystem_p_yellow()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
public class Sound
|
||||
{
|
||||
|
||||
public static const TITLE_MUSIC:Class = Sound_TITLE_MUSIC;
|
||||
|
||||
public static const PLAY_MUSIC:Class = Sound_PLAY_MUSIC;
|
||||
|
||||
public static const PLAY_MUSIC2:Class = Sound_PLAY_MUSIC2;
|
||||
|
||||
public static const BOSS_MUSIC:Class = Sound_BOSS_MUSIC;
|
||||
|
||||
public static const DIAMOND1:Class = Sound_DIAMOND1;
|
||||
|
||||
public static const DIAMOND2:Class = Sound_DIAMOND2;
|
||||
|
||||
public static const DIAMOND3:Class = Sound_DIAMOND3;
|
||||
|
||||
public static const DIAMOND4:Class = Sound_DIAMOND4;
|
||||
|
||||
public static const DIAMOND5:Class = Sound_DIAMOND5;
|
||||
|
||||
public static const SHOOT_SMALL:Class = Sound_SHOOT_SMALL;
|
||||
|
||||
public static const MENU_SELECT:Class = Sound_MENU_SELECT;
|
||||
|
||||
public static const MENU_CLICK:Class = Sound_MENU_CLICK;
|
||||
|
||||
public static const PLAYER_DIE:Class = Sound_PLAYER_DIE;
|
||||
|
||||
public static const ENEMY_DIE:Class = Sound_ENEMY_DIE;
|
||||
|
||||
public static const ACHIEVEMENT:Class = Sound_ACHIEVEMENT;
|
||||
|
||||
public static const CHECKPOINT:Class = Sound_CHECKPOINT;
|
||||
|
||||
public static const POWERUP:Class = Sound_POWERUP;
|
||||
|
||||
public static const WIN:Class = Sound_WIN;
|
||||
|
||||
public static const HURT:Class = Sound_HURT;
|
||||
|
||||
public static const HEART:Class = Sound_HEART;
|
||||
|
||||
public static const RED_DIAMOND:Class = Sound_RED_DIAMOND;
|
||||
|
||||
public static const HEART_CRYSTAL:Class = Sound_HEART_CRYSTAL;
|
||||
|
||||
public static const EQUIPMENT:Class = Sound_EQUIPMENT;
|
||||
|
||||
public static const BUY:Class = Sound_BUY;
|
||||
|
||||
public static const TEXT:Class = Sound_TEXT;
|
||||
|
||||
public static const PLINK:Class = Sound_PLINK;
|
||||
|
||||
public static const JUMP0:Class = Sound_JUMP0;
|
||||
|
||||
public static const JUMP1:Class = Sound_JUMP1;
|
||||
|
||||
public static const JUMP2:Class = Sound_JUMP2;
|
||||
|
||||
public static const JUMP3:Class = Sound_JUMP3;
|
||||
|
||||
public static const POT:Class = Sound_POT;
|
||||
|
||||
public static const BOX:Class = Sound_BOX;
|
||||
|
||||
public static const STEELBOX:Class = Sound_STEELBOX;
|
||||
|
||||
public static const EXPLODE1:Class = Sound_EXPLODE1;
|
||||
|
||||
public static const EXPLODE2:Class = Sound_EXPLODE2;
|
||||
|
||||
public static const EXPLODE3:Class = Sound_EXPLODE3;
|
||||
|
||||
public static const EXPLODE4:Class = Sound_EXPLODE4;
|
||||
|
||||
public static const EXPLODE5:Class = Sound_EXPLODE5;
|
||||
|
||||
public function Sound()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import org.flixel.FlxG;
|
||||
import org.flixel.FlxSound;
|
||||
|
||||
public class SoundSystem
|
||||
{
|
||||
|
||||
public static var playing:Class;
|
||||
|
||||
public static var wasPlaying:FlxSound;
|
||||
|
||||
public static var playingVolume:Number;
|
||||
|
||||
public function SoundSystem()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function music(param1:Class, param2:Number = 1, param3:Number = 0) : void
|
||||
{
|
||||
if(playing != param1)
|
||||
{
|
||||
if(Data.music == Data.ON)
|
||||
{
|
||||
if(playing != null)
|
||||
{
|
||||
if(wasPlaying != null && wasPlaying.active)
|
||||
{
|
||||
wasPlaying.stop();
|
||||
}
|
||||
wasPlaying = FlxG.music;
|
||||
wasPlaying.fadeOut(2);
|
||||
FlxG.music = null;
|
||||
}
|
||||
FlxG.playMusic(param1,0.5,param3);
|
||||
FlxG.music.fadeIn(2);
|
||||
}
|
||||
playing = param1;
|
||||
playingVolume = param2;
|
||||
}
|
||||
}
|
||||
|
||||
public static function update() : void
|
||||
{
|
||||
if(wasPlaying != null && wasPlaying.active)
|
||||
{
|
||||
wasPlaying.update();
|
||||
}
|
||||
}
|
||||
|
||||
public static function fadeOutMusic(param1:Number = 0.5) : void
|
||||
{
|
||||
if(FlxG.music != null)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static function play(param1:Class, param2:Number = 1) : void
|
||||
{
|
||||
if(Data.sound == Data.ON)
|
||||
{
|
||||
FlxG.play(param1,param2);
|
||||
}
|
||||
}
|
||||
|
||||
public static function mute() : void
|
||||
{
|
||||
FlxG.music.stop();
|
||||
Data.music = Data.OFF;
|
||||
}
|
||||
|
||||
public static function unmute() : void
|
||||
{
|
||||
FlxG.playMusic(playing,playingVolume);
|
||||
Data.music = Data.ON;
|
||||
}
|
||||
|
||||
public static function muteSounds() : void
|
||||
{
|
||||
Data.sound = Data.OFF;
|
||||
}
|
||||
|
||||
public static function unmuteSounds() : void
|
||||
{
|
||||
Data.sound = Data.ON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/32_com.arc.dh.util.Sound_ACHIEVEMENT_com.arc.dh.util.Sound_ACHIEVEMENT.mp3")]
|
||||
public class Sound_ACHIEVEMENT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_ACHIEVEMENT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/7_com.arc.dh.util.Sound_BOSS_MUSIC_com.arc.dh.util.Sound_BOSS_MUSIC.mp3")]
|
||||
public class Sound_BOSS_MUSIC extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_BOSS_MUSIC()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/8_com.arc.dh.util.Sound_BOX_com.arc.dh.util.Sound_BOX.mp3")]
|
||||
public class Sound_BOX extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_BOX()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/38_com.arc.dh.util.Sound_BUY_com.arc.dh.util.Sound_BUY.mp3")]
|
||||
public class Sound_BUY extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_BUY()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/12_com.arc.dh.util.Sound_CHECKPOINT_com.arc.dh.util.Sound_CHECKPOINT.mp3")]
|
||||
public class Sound_CHECKPOINT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_CHECKPOINT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/14_com.arc.dh.util.Sound_DIAMOND1_com.arc.dh.util.Sound_DIAMOND1.mp3")]
|
||||
public class Sound_DIAMOND1 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_DIAMOND1()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/13_com.arc.dh.util.Sound_DIAMOND2_com.arc.dh.util.Sound_DIAMOND2.mp3")]
|
||||
public class Sound_DIAMOND2 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_DIAMOND2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/17_com.arc.dh.util.Sound_DIAMOND3_com.arc.dh.util.Sound_DIAMOND3.mp3")]
|
||||
public class Sound_DIAMOND3 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_DIAMOND3()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/15_com.arc.dh.util.Sound_DIAMOND4_com.arc.dh.util.Sound_DIAMOND4.mp3")]
|
||||
public class Sound_DIAMOND4 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_DIAMOND4()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/26_com.arc.dh.util.Sound_DIAMOND5_com.arc.dh.util.Sound_DIAMOND5.mp3")]
|
||||
public class Sound_DIAMOND5 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_DIAMOND5()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/5_com.arc.dh.util.Sound_ENEMY_DIE_com.arc.dh.util.Sound_ENEMY_DIE.mp3")]
|
||||
public class Sound_ENEMY_DIE extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_ENEMY_DIE()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/11_com.arc.dh.util.Sound_EQUIPMENT_com.arc.dh.util.Sound_EQUIPMENT.mp3")]
|
||||
public class Sound_EQUIPMENT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EQUIPMENT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/18_com.arc.dh.util.Sound_EXPLODE1_com.arc.dh.util.Sound_EXPLODE1.mp3")]
|
||||
public class Sound_EXPLODE1 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EXPLODE1()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/23_com.arc.dh.util.Sound_EXPLODE2_com.arc.dh.util.Sound_EXPLODE2.mp3")]
|
||||
public class Sound_EXPLODE2 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EXPLODE2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/25_com.arc.dh.util.Sound_EXPLODE3_com.arc.dh.util.Sound_EXPLODE3.mp3")]
|
||||
public class Sound_EXPLODE3 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EXPLODE3()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/19_com.arc.dh.util.Sound_EXPLODE4_com.arc.dh.util.Sound_EXPLODE4.mp3")]
|
||||
public class Sound_EXPLODE4 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EXPLODE4()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/21_com.arc.dh.util.Sound_EXPLODE5_com.arc.dh.util.Sound_EXPLODE5.mp3")]
|
||||
public class Sound_EXPLODE5 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_EXPLODE5()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/28_com.arc.dh.util.Sound_HEART_com.arc.dh.util.Sound_HEART.mp3")]
|
||||
public class Sound_HEART extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_HEART()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/37_com.arc.dh.util.Sound_HEART_CRYSTAL_com.arc.dh.util.Sound_HEART_CRYSTAL.mp3")]
|
||||
public class Sound_HEART_CRYSTAL extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_HEART_CRYSTAL()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/35_com.arc.dh.util.Sound_HURT_com.arc.dh.util.Sound_HURT.mp3")]
|
||||
public class Sound_HURT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_HURT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/27_com.arc.dh.util.Sound_JUMP0_com.arc.dh.util.Sound_JUMP0.mp3")]
|
||||
public class Sound_JUMP0 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_JUMP0()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/20_com.arc.dh.util.Sound_JUMP1_com.arc.dh.util.Sound_JUMP1.mp3")]
|
||||
public class Sound_JUMP1 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_JUMP1()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/22_com.arc.dh.util.Sound_JUMP2_com.arc.dh.util.Sound_JUMP2.mp3")]
|
||||
public class Sound_JUMP2 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_JUMP2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/24_com.arc.dh.util.Sound_JUMP3_com.arc.dh.util.Sound_JUMP3.mp3")]
|
||||
public class Sound_JUMP3 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_JUMP3()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/33_com.arc.dh.util.Sound_MENU_CLICK_com.arc.dh.util.Sound_MENU_CLICK.mp3")]
|
||||
public class Sound_MENU_CLICK extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_MENU_CLICK()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/36_com.arc.dh.util.Sound_MENU_SELECT_com.arc.dh.util.Sound_MENU_SELECT.mp3")]
|
||||
public class Sound_MENU_SELECT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_MENU_SELECT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/10_com.arc.dh.util.Sound_PLAYER_DIE_com.arc.dh.util.Sound_PLAYER_DIE.mp3")]
|
||||
public class Sound_PLAYER_DIE extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_PLAYER_DIE()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/9_com.arc.dh.util.Sound_PLAY_MUSIC_com.arc.dh.util.Sound_PLAY_MUSIC.mp3")]
|
||||
public class Sound_PLAY_MUSIC extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_PLAY_MUSIC()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/4_com.arc.dh.util.Sound_PLAY_MUSIC2_com.arc.dh.util.Sound_PLAY_MUSIC2.mp3")]
|
||||
public class Sound_PLAY_MUSIC2 extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_PLAY_MUSIC2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/30_com.arc.dh.util.Sound_PLINK_com.arc.dh.util.Sound_PLINK.mp3")]
|
||||
public class Sound_PLINK extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_PLINK()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/34_com.arc.dh.util.Sound_POT_com.arc.dh.util.Sound_POT.mp3")]
|
||||
public class Sound_POT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_POT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/3_com.arc.dh.util.Sound_POWERUP_com.arc.dh.util.Sound_POWERUP.mp3")]
|
||||
public class Sound_POWERUP extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_POWERUP()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/31_com.arc.dh.util.Sound_RED_DIAMOND_com.arc.dh.util.Sound_RED_DIAMOND.mp3")]
|
||||
public class Sound_RED_DIAMOND extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_RED_DIAMOND()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/6_com.arc.dh.util.Sound_SHOOT_SMALL_com.arc.dh.util.Sound_SHOOT_SMALL.mp3")]
|
||||
public class Sound_SHOOT_SMALL extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_SHOOT_SMALL()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/29_com.arc.dh.util.Sound_STEELBOX_com.arc.dh.util.Sound_STEELBOX.mp3")]
|
||||
public class Sound_STEELBOX extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_STEELBOX()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/40_com.arc.dh.util.Sound_TEXT_com.arc.dh.util.Sound_TEXT.mp3")]
|
||||
public class Sound_TEXT extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_TEXT()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/39_com.arc.dh.util.Sound_TITLE_MUSIC_com.arc.dh.util.Sound_TITLE_MUSIC.mp3")]
|
||||
public class Sound_TITLE_MUSIC extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_TITLE_MUSIC()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util
|
||||
{
|
||||
import mx.core.SoundAsset;
|
||||
|
||||
[Embed(source="/_assets/16_com.arc.dh.util.Sound_WIN_com.arc.dh.util.Sound_WIN.mp3")]
|
||||
public class Sound_WIN extends SoundAsset
|
||||
{
|
||||
|
||||
public function Sound_WIN()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import com.arc.flixel.ArcSprite;
|
||||
|
||||
public class Avatar
|
||||
{
|
||||
|
||||
public static const SAGA_SPRITE:Class = Avatar_SAGA_SPRITE;
|
||||
|
||||
public static const PROFESSOR_SPRITE:Class = Avatar_PROFESSOR_SPRITE;
|
||||
|
||||
public static const X:int = 57;
|
||||
|
||||
public static const Y:int = 223;
|
||||
|
||||
public static const SAGA:ArcSprite = new ArcSprite(0,0,SAGA_SPRITE);
|
||||
|
||||
public static const PROFESSOR:ArcSprite = new ArcSprite(0,0,PROFESSOR_SPRITE);
|
||||
|
||||
public function Avatar()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/265_com.arc.dh.util.text.Avatar_PROFESSOR_SPRITE.png")]
|
||||
public class Avatar_PROFESSOR_SPRITE extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Avatar_PROFESSOR_SPRITE()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/116_com.arc.dh.util.text.Avatar_SAGA_SPRITE.png")]
|
||||
public class Avatar_SAGA_SPRITE extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Avatar_SAGA_SPRITE()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.flixel.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class TextFrame extends ArcGroup
|
||||
{
|
||||
|
||||
private static const frameSprite:Class = TextFrame_frameSprite;
|
||||
|
||||
private static const SCROLL_IN:int = 0;
|
||||
|
||||
private static const SHOWING:int = 1;
|
||||
|
||||
private static const SCROLL_OUT:int = 2;
|
||||
|
||||
private static const HIDING:int = 3;
|
||||
|
||||
private static const TARGET_Y:Number = Config.HEIGHT - 21;
|
||||
|
||||
public static const SCROLL_SPEED:Number = 50;
|
||||
|
||||
private var _frame:ArcSprite;
|
||||
|
||||
private var _state:int = 3;
|
||||
|
||||
public function TextFrame(param1:Number = 0, param2:Number = 0)
|
||||
{
|
||||
super(param1,param2);
|
||||
this._frame = new ArcSprite(0,0,frameSprite);
|
||||
add(this._frame);
|
||||
}
|
||||
|
||||
public function reset() : void
|
||||
{
|
||||
this._state = HIDING;
|
||||
this._frame.y = Config.HEIGHT;
|
||||
}
|
||||
|
||||
public function get ready() : Boolean
|
||||
{
|
||||
return this._state == SHOWING;
|
||||
}
|
||||
|
||||
public function get hidden() : Boolean
|
||||
{
|
||||
return this._state == HIDING;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._state == SCROLL_IN)
|
||||
{
|
||||
this._frame.y -= FlxG.elapsed * SCROLL_SPEED;
|
||||
if(this._frame.y < TARGET_Y)
|
||||
{
|
||||
this._frame.y = TARGET_Y;
|
||||
this._state = SHOWING;
|
||||
}
|
||||
}
|
||||
else if(this._state != SHOWING)
|
||||
{
|
||||
if(this._state == SCROLL_OUT)
|
||||
{
|
||||
this._frame.y += FlxG.elapsed * SCROLL_SPEED;
|
||||
if(this._frame.y > Config.HEIGHT)
|
||||
{
|
||||
this._frame.y = Config.HEIGHT;
|
||||
visible = false;
|
||||
this._state = HIDING;
|
||||
}
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
public function show() : void
|
||||
{
|
||||
visible = true;
|
||||
this._state = SCROLL_IN;
|
||||
}
|
||||
|
||||
public function hide() : void
|
||||
{
|
||||
this._state = SCROLL_OUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/149_com.arc.dh.util.text.TextFrame_frameSprite.png")]
|
||||
public class TextFrame_frameSprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function TextFrame_frameSprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import org.flixel.FlxBitmapFont;
|
||||
import org.flixel.FlxBitmapText;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class TextLine extends FlxBitmapText
|
||||
{
|
||||
|
||||
private var _offset:int = 0;
|
||||
|
||||
private var _fulltext:String;
|
||||
|
||||
private var _textOffset:int = 0;
|
||||
|
||||
private var _delay:Number = 0.02;
|
||||
|
||||
private var _active:Boolean = false;
|
||||
|
||||
private var _done:Boolean = false;
|
||||
|
||||
private var _targety:int = 0;
|
||||
|
||||
private var _vy:Number = 0;
|
||||
|
||||
private var _fading:Boolean = false;
|
||||
|
||||
public function TextLine(param1:int, param2:FlxBitmapFont, param3:String = " ", param4:String = "left", param5:Number = 0, param6:Boolean = false)
|
||||
{
|
||||
super(TextSystem.FRAME_OFFSET + TextSystem.TEXT_OFFSET,223 + param1 * 8,param2,"",param4,param5,param6);
|
||||
this._fulltext = param3;
|
||||
this._offset = param1;
|
||||
alpha = 0.7;
|
||||
visible = false;
|
||||
solid = false;
|
||||
}
|
||||
|
||||
public function push() : void
|
||||
{
|
||||
this._targety = y - 8;
|
||||
this._vy = -20;
|
||||
--this._offset;
|
||||
if(this._offset == -1)
|
||||
{
|
||||
this._fading = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function show() : void
|
||||
{
|
||||
visible = true;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(!this._done && this._active)
|
||||
{
|
||||
this._delay -= FlxG.elapsed;
|
||||
if(this._delay <= 0)
|
||||
{
|
||||
this._delay = TextSystem.TYPE_SPEED * TextSystem.speed;
|
||||
this.addCharacter();
|
||||
}
|
||||
}
|
||||
if(this._vy != 0)
|
||||
{
|
||||
y += this._vy * FlxG.elapsed;
|
||||
if(y <= this._targety)
|
||||
{
|
||||
y = this._targety;
|
||||
this._vy = 0;
|
||||
}
|
||||
}
|
||||
if(this._fading)
|
||||
{
|
||||
alpha -= FlxG.elapsed * TextSystem.FADE_SPEED;
|
||||
if(alpha <= 0)
|
||||
{
|
||||
exists = false;
|
||||
visible = false;
|
||||
alive = false;
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
private function addCharacter() : void
|
||||
{
|
||||
++this._textOffset;
|
||||
text = this._fulltext.substr(0,this._textOffset);
|
||||
if(this._fulltext.charAt(this._textOffset - 1) == ".")
|
||||
{
|
||||
this._delay = TextSystem.FULL_STOP_DELAY * TextSystem.speed;
|
||||
}
|
||||
else if(this._fulltext.charAt(this._textOffset - 1) == ",")
|
||||
{
|
||||
this._delay = TextSystem.HALF_STOP_DELAY * TextSystem.speed;
|
||||
}
|
||||
if(this._textOffset == this._fulltext.length)
|
||||
{
|
||||
this._done = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function get done() : Boolean
|
||||
{
|
||||
return this._done;
|
||||
}
|
||||
|
||||
public function activate() : void
|
||||
{
|
||||
this._active = true;
|
||||
this.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
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 TextSet extends ArcGroup
|
||||
{
|
||||
|
||||
private var _avatar:ArcSprite;
|
||||
|
||||
private var _text:String;
|
||||
|
||||
private var _activeText:TextLine;
|
||||
|
||||
private var _textQueue:Array = new Array();
|
||||
|
||||
private var _numShown:int = 0;
|
||||
|
||||
private var _textDelay:Number = 0;
|
||||
|
||||
private var _textMembers:Array = new Array();
|
||||
|
||||
private var _hiding:Boolean = false;
|
||||
|
||||
public function TextSet(param1:Array)
|
||||
{
|
||||
var _loc5_:TextLine = null;
|
||||
super();
|
||||
this._avatar = param1[0];
|
||||
this._text = param1[1].toUpperCase();
|
||||
var _loc2_:FlxBitmapText = new FlxBitmapText(0,0,Fonts.font(Fonts.OUTLINE_BLUE),this._text,"left",TextSystem.TEXT_WIDTH);
|
||||
var _loc3_:Array = _loc2_.lines;
|
||||
var _loc4_:int = 0;
|
||||
while(_loc4_ < _loc3_.length)
|
||||
{
|
||||
_loc5_ = new TextLine(_loc4_,Fonts.font(Fonts.OUTLINE_BLACK),_loc3_[_loc4_] as String,"left",TextSystem.TEXT_WIDTH + 50,true);
|
||||
this.add(_loc5_);
|
||||
this._textQueue.push(_loc5_);
|
||||
this._textMembers.push(_loc5_);
|
||||
_loc4_++;
|
||||
}
|
||||
this._avatar.x = Avatar.X;
|
||||
this._avatar.y = Avatar.Y;
|
||||
this.add(this._avatar);
|
||||
this.next();
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(this._activeText != null && this._activeText.done)
|
||||
{
|
||||
if(this._textDelay <= 0)
|
||||
{
|
||||
this.next();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._textDelay -= FlxG.elapsed;
|
||||
}
|
||||
}
|
||||
if(this._activeText == null && this._textDelay > 0)
|
||||
{
|
||||
this._textDelay -= FlxG.elapsed;
|
||||
}
|
||||
if(this._hiding)
|
||||
{
|
||||
this._textMembers.forEach(function(param1:TextLine, param2:int, param3:Array):void
|
||||
{
|
||||
if(param1.visible)
|
||||
{
|
||||
param1.y += FlxG.elapsed * TextFrame.SCROLL_SPEED;
|
||||
}
|
||||
});
|
||||
this._avatar.y += FlxG.elapsed * TextFrame.SCROLL_SPEED;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
private function next() : void
|
||||
{
|
||||
var _loc1_:TextLine = null;
|
||||
this._activeText = this._textQueue.shift();
|
||||
if(this._activeText != null)
|
||||
{
|
||||
this._activeText.activate();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._textDelay = TextSystem.TEXT_DELAY * TextSystem.speed;
|
||||
}
|
||||
if(++this._numShown >= 3 && this._activeText != null)
|
||||
{
|
||||
for each(_loc1_ in this._textMembers)
|
||||
{
|
||||
_loc1_.push();
|
||||
}
|
||||
}
|
||||
if(this._numShown % 2 == 0 && this._numShown > 1)
|
||||
{
|
||||
this._textDelay = TextSystem.TEXT_DELAY * TextSystem.speed;
|
||||
}
|
||||
}
|
||||
|
||||
public function get done() : Boolean
|
||||
{
|
||||
return this._activeText == null && this._textDelay <= 0;
|
||||
}
|
||||
|
||||
public function hide() : void
|
||||
{
|
||||
this._hiding = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.arc.dh.util.text
|
||||
{
|
||||
import com.arc.dh.state.PlayMode;
|
||||
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.ArcGroup;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxPoint;
|
||||
|
||||
public class TextSystem extends ArcGroup
|
||||
{
|
||||
|
||||
private static var _instance:TextSystem;
|
||||
|
||||
private static const IDLE:int = 0;
|
||||
|
||||
private static const SCROLL_IN:int = 1;
|
||||
|
||||
private static const SHOWING:int = 2;
|
||||
|
||||
private static const SCROLL_OUT:int = 3;
|
||||
|
||||
public static const FRAME_WIDTH:int = 255;
|
||||
|
||||
public static const FRAME_OFFSET:int = 53;
|
||||
|
||||
public static const TEXT_WIDTH:int = 224;
|
||||
|
||||
public static const TEXT_OFFSET:int = 21;
|
||||
|
||||
public static const TYPE_SPEED:Number = 0.02;
|
||||
|
||||
public static const FADE_SPEED:Number = 5;
|
||||
|
||||
public static const TEXT_DELAY:Number = 2;
|
||||
|
||||
public static const FULL_STOP_DELAY:Number = 0.25;
|
||||
|
||||
public static const HALF_STOP_DELAY:Number = 0.1;
|
||||
|
||||
private var _texts:Array;
|
||||
|
||||
private var _currentText:Array;
|
||||
|
||||
private var _state:int;
|
||||
|
||||
private var _frame:TextFrame;
|
||||
|
||||
private var _textset:TextSet;
|
||||
|
||||
public var recent:Array = new Array();
|
||||
|
||||
public function TextSystem()
|
||||
{
|
||||
super();
|
||||
this._texts = new Array();
|
||||
this._currentText = new Array();
|
||||
this._state = IDLE;
|
||||
this._frame = new TextFrame(FRAME_OFFSET,Config.HEIGHT + 21);
|
||||
this.add(this._frame);
|
||||
setAll("scrollFactor",new FlxPoint(0,0));
|
||||
}
|
||||
|
||||
public static function get speed() : Number
|
||||
{
|
||||
return Data.textspeed == Data.SPEED_FAST ? 0.5 : (Data.textspeed == Data.SPEED_SLOW ? 2 : 1);
|
||||
}
|
||||
|
||||
public static function reset() : void
|
||||
{
|
||||
if(instance._texts == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
instance._texts = new Array();
|
||||
instance._currentText = new Array();
|
||||
instance._state = IDLE;
|
||||
instance._frame.reset();
|
||||
instance._textset = null;
|
||||
}
|
||||
|
||||
public static function get instance() : TextSystem
|
||||
{
|
||||
return _instance == null ? (_instance = new TextSystem()) : _instance;
|
||||
}
|
||||
|
||||
public static function display(param1:ArcSprite, param2:String) : void
|
||||
{
|
||||
if(PlayMode.mode != PlayMode.STORY_MODE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
instance._texts.push([param1,param2]);
|
||||
if(instance.recent.length == 0 || instance.recent[instance.recent.length - 1][1] != param2)
|
||||
{
|
||||
instance.recent.push([param1,param2]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function active() : Boolean
|
||||
{
|
||||
return instance._state != IDLE || _instance._texts.length != 0;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
switch(this._state)
|
||||
{
|
||||
case IDLE:
|
||||
this.idle();
|
||||
break;
|
||||
case SCROLL_IN:
|
||||
this.scrollIn();
|
||||
break;
|
||||
case SHOWING:
|
||||
this.showing();
|
||||
break;
|
||||
case SCROLL_OUT:
|
||||
this.scrollOut();
|
||||
}
|
||||
super.update();
|
||||
if(this._textset != null)
|
||||
{
|
||||
this._textset.update();
|
||||
}
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
super.draw();
|
||||
if(this._textset != null)
|
||||
{
|
||||
this._textset.draw();
|
||||
}
|
||||
}
|
||||
|
||||
private function idle() : void
|
||||
{
|
||||
if(this._texts.length > 0)
|
||||
{
|
||||
SoundSystem.play(Sound.TEXT);
|
||||
this._state = SCROLL_IN;
|
||||
this._frame.show();
|
||||
}
|
||||
}
|
||||
|
||||
private function scrollIn() : void
|
||||
{
|
||||
if(this._frame.ready)
|
||||
{
|
||||
this._state = SHOWING;
|
||||
this.setup();
|
||||
}
|
||||
}
|
||||
|
||||
private function showing() : void
|
||||
{
|
||||
if(this._textset.done)
|
||||
{
|
||||
if(this._texts.length > 0)
|
||||
{
|
||||
this.setup();
|
||||
}
|
||||
else
|
||||
{
|
||||
this._state = SCROLL_OUT;
|
||||
this._textset.hide();
|
||||
this._frame.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function scrollOut() : void
|
||||
{
|
||||
if(this._frame.hidden)
|
||||
{
|
||||
this._state = IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
private function setup() : void
|
||||
{
|
||||
var _loc1_:Array = this._texts.shift();
|
||||
this._textset = new TextSet(_loc1_);
|
||||
}
|
||||
|
||||
override public function destroy() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user