initial commit, kind of working.

This commit is contained in:
2026-10-10 15:50:17 -06:00
commit 4db96b0bae
1041 changed files with 51423 additions and 0 deletions
@@ -0,0 +1,59 @@
package com.arc.dh.state
{
import flash.display.Loader;
import flash.events.Event;
import flash.media.SoundMixer;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import org.flixel.FlxG;
import org.flixel.FlxState;
public class AG extends FlxState
{
private static var AG:Class = AG_AG;
private var len:Number = 220;
private var zoomFactor:int = 1;
private var movie:Loader;
public function AG()
{
super();
}
override public function create() : void
{
this.movie = new Loader();
var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
this.movie.loadBytes(new AG(),_loc1_);
this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve);
}
private function contentsRetrieve(param1:Event) : void
{
this.movie.scaleX = 1 / this.zoomFactor;
this.movie.scaleY = 1 / this.zoomFactor;
this.movie.x = 10;
this.movie.y = 40;
FlxG.stage.addChildAt(this.movie,0);
this.movie.addEventListener(Event.EXIT_FRAME,this.next);
}
private function next(param1:Event) : void
{
--this.len;
if(this.len <= 0)
{
FlxG.stage.removeChildAt(0);
SoundMixer.stopAll();
this.movie.removeEventListener(Event.EXIT_FRAME,this.next);
this.movie.unload();
FlxG.switchState(new MainMenu());
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.ByteArrayAsset;
[Embed(source="/_assets/45_com.arc.dh.state.AG_AG.bin", mimeType="application/octet-stream")]
public class AG_AG extends ByteArrayAsset
{
public function AG_AG()
{
super();
}
}
}
@@ -0,0 +1,33 @@
package com.arc.dh.state
{
import com.arc.flixel.ArcSprite;
public class Background extends ArcSprite
{
public var vertical:Boolean = true;
public function Background(param1:Number = 0, param2:Number = 0, param3:Class = null)
{
super(param1,param2,param3);
}
override public function draw() : void
{
super.draw();
if(this.vertical)
{
y += 420;
super.draw();
y -= 420;
}
else
{
x += 360;
super.draw();
x -= 360;
}
}
}
}
@@ -0,0 +1,60 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxG;
import org.flixel.FlxObject;
public class BeginnerTip extends ArcSprite
{
private var _padding:int;
public function BeginnerTip(param1:Number, param2:Number, param3:Class, param4:int = 0)
{
super(param1,param2,param3);
alpha = 0.5;
this._padding = param4;
}
override public function update() : void
{
var _loc1_:Number = NaN;
if(alive)
{
_loc1_ = 0.5;
if(!solid)
{
alpha -= FlxG.elapsed * _loc1_ * 2;
if(alpha <= 0)
{
visible = false;
alive = false;
}
}
else if(!immovable)
{
alpha -= FlxG.elapsed * _loc1_;
if(alpha < 0.2)
{
immovable = true;
}
}
else
{
alpha += FlxG.elapsed * _loc1_;
if(alpha >= 0.6)
{
immovable = false;
}
}
if(Data.state.player.y < y + height + 40 - this._padding && Boolean(Data.state.player.wasTouching & FlxObject.DOWN))
{
solid = false;
}
}
super.update();
}
}
}
@@ -0,0 +1,82 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
import com.arc.dh.util.Fonts;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcGroup;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxBitmapText;
import org.flixel.FlxG;
public class BossButton extends ArcGroup
{
private static const buttonSprite:Class = BossButton_buttonSprite;
private static const lockSprite:Class = BossButton_lockSprite;
private var _boss:int;
private var _button:ArcButton;
private var _text:FlxBitmapText;
private var _lock:ArcSprite;
private var _screen:BossScreen;
public function BossButton(param1:Number, param2:Number, param3:int)
{
var X:Number = param1;
var Y:Number = param2;
var H:int = param3;
super();
this._boss = H + 1;
this._button = new ArcButton(X,Y,42,16,buttonSprite).selectable(false).callback(function():void
{
if(!FlxG.keys.SHIFT || Data.boss[0] != 0)
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new BossMode(FlxG.keys.SHIFT,_boss,true));
});
}
});
this.add(this._button);
this._text = new FlxBitmapText(X,Y + 4,Fonts.font(Fonts.OUTLINE_BLACK_S),"CHAPT " + this._boss,"right",37);
this.add(this._text);
}
public function setScreen(param1:BossScreen) : void
{
this._screen = param1;
}
override public function update() : void
{
if(this._button.hover() && this._lock != null)
{
if(this._screen.tooltip == null || this._screen.tooltip.source != this)
{
this._screen.tooltip = new BossModeTooltip(this._button.x + 21,this._button.y,this._boss);
this._screen.tooltip.source = this;
}
this._screen.hovering = true;
}
super.update();
}
override public function draw() : void
{
super.draw();
if(this._lock != null)
{
this._lock.draw();
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/124.png")]
public class BossButton_buttonSprite extends BitmapAsset
{
public function BossButton_buttonSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/270.png")]
public class BossButton_lockSprite extends BitmapAsset
{
public function BossButton_lockSprite()
{
super();
}
}
}
@@ -0,0 +1,321 @@
package com.arc.dh.state
{
import Playtomic.Log;
import com.arc.dh.entities.Player;
import com.arc.dh.menu.GameOver;
import com.arc.dh.objects.*;
import com.arc.dh.util.Config;
import com.arc.dh.util.Data;
import com.arc.dh.util.DataSerializer;
import com.arc.dh.util.Sound;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcParticleSystem;
import com.arc.flixel.ArcSprite;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import org.flixel.FlxG;
import org.flixel.FlxObject;
import org.flixel.FlxPoint;
import org.flixel.FlxTilemap;
import org.flixel.system.FlxTile;
public class BossMode extends PlayMode
{
private static const ESCAPE_HEIGHT:int = 2000;
private static const ESCAPE_WIDTH:int = 30;
private static const BOTTOM_PADDING:int = 1;
private static const PLATFORM_SIZE:int = 3;
private static const LAVA_TELEPORT_DISTANCE:int = 220;
private var sourcePixels:BitmapData;
private var blankOverlay:BitmapData;
private var _gameOver:GameOver;
private var _heroic:Boolean = false;
private var _stage:int = 1;
private var _practice:Boolean = false;
public function BossMode(param1:Boolean, param2:int = 1, param3:Boolean = false)
{
super();
mode = BOSS_MODE;
this._stage = param2;
_ch = param2;
this._heroic = param1;
this._practice = param3;
this.sourcePixels = new BitmapData(30,20,false);
this.blankOverlay = new BitmapData(30,20,false);
}
public function isHeroic() : Boolean
{
return this._heroic;
}
public function isPractice() : Boolean
{
return this._practice;
}
override public function create() : void
{
super.create();
Log.CustomMetric("BossStart","Modes");
FlxG.camera.follow(null);
SoundSystem.music(Sound.BOSS_MUSIC);
}
override protected function getStartX() : int
{
switch(this._stage)
{
case 1:
return 64;
case 2:
return 300;
case 3:
return 210;
case 4:
return 64;
case 5:
return 48;
case 6:
return 64;
case 7:
return 300;
default:
return 64;
}
}
override protected function getStartY() : int
{
if(this._stage == 5)
{
return 96;
}
return 60;
}
override public function update() : void
{
if(_complete)
{
this._gameOver.update();
return;
}
super.update();
if(inMenu)
{
return;
}
}
override protected function createLevel() : void
{
tilemap = this.buildLevel();
tilemap.follow();
}
override public function die() : void
{
_dieTimer = 1;
++Data.deaths;
DataSerializer.save();
}
override public function reset() : void
{
_complete = true;
inMenu = false;
SoundSystem.play(Sound.WIN);
this._gameOver = new GameOver(null,null,null).setCallback(function():void
{
FlxG.switchState(new BossMode(_heroic,_practice ? _stage : 1,_practice));
},function():void
{
FlxG.switchState(new MainMenu(2));
});
}
override public function complete() : void
{
var newTime:Number = NaN;
var index:int = 0;
_complete = true;
inMenu = false;
if(!this._practice && _ch < 7)
{
FlxG.switchState(new BossMode(this._heroic,this._stage + 1));
DataSerializer.save();
return;
}
if(!this._practice && _ch == 7)
{
newTime = Math.ceil(Data.ctime) * 1000;
index = this.isHeroic() ? 1 : 0;
if(newTime < Data.boss[1 + 2 * index] || Data.boss[1 + 2 * index] == 0)
{
Data.boss[1 + 2 * index] = newTime;
}
++Data.boss[2 * index];
}
DataSerializer.save();
Data.kong();
Newgrounds.medals();
SoundSystem.play(Sound.WIN);
this._gameOver = new GameOver(null,null,duration).setCallback(function():void
{
if(_practice)
{
FlxG.switchState(new BossMode(_heroic,_stage,_practice));
}
else
{
FlxG.switchState(new BossMode(_heroic,1,_practice));
}
},function():void
{
FlxG.switchState(new MainMenu(2));
});
}
override public function restart() : void
{
var _loc2_:StoryDialog = null;
var _loc1_:Array = checkpoints[checkpoints.length - 1];
player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12);
FlxG.camera.focusOn(new FlxPoint(player.x,player.y));
FlxG.camera.follow(player);
boss = 0;
spawner = new Object();
pixels = mpixels.clone();
for each(_loc2_ in messages)
{
_loc2_.load();
}
bullets.clear();
enemies.clear();
penemies.clear();
diamonds.clear();
powerups.clear();
damagetexts.clear();
healthbars.clear();
objects.clear();
cobjects.clear();
spawnTop = this.calcTop(Config.SPAWN_PADDING);
spawnBottom = this.calcBottom(Config.SPAWN_PADDING);
despawnTop = player.y / Config.BLOCK_SIZE;
despawnBottom = player.y / Config.BLOCK_SIZE + 1;
}
private function createSourcePixels() : void
{
var _loc1_:BitmapData = new ArcSprite(0,0,StoryMode["CH" + this._stage]).pixels;
var _loc2_:Rectangle = new Rectangle(0,0,30,20);
this.sourcePixels.copyPixels(_loc1_,_loc2_,new Point(0,0));
}
private function buildLevel() : FlxTilemap
{
var tileArray:Array;
var tileCSV:String;
var waterFunction:Function;
var map:FlxTilemap = null;
this.createSourcePixels();
tileArray = this.imageToTileArray(this.sourcePixels,this.blankOverlay);
tileCSV = FlxTilemap.arrayToCSV(tileArray,Config.BLOCK_WIDTH);
map = new FlxTilemap();
map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80);
map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void
{
if(param2 is Bullet)
{
ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height);
map.setTileByIndex(param1.mapIndex,0,true);
}
});
map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void
{
if(param2 is Missile)
{
ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height);
map.setTileByIndex(param1.mapIndex,0,true);
}
});
waterFunction = function(param1:FlxTile, param2:FlxObject):void
{
var _loc3_:Player = param2 as Player;
if(_loc3_ == null)
{
return;
}
_loc3_.inWater();
};
map.setTileProperties(12,FlxObject.NONE,waterFunction,Player);
map.setTileProperties(56,FlxObject.ANY);
return map;
}
private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array
{
var _loc5_:int = 0;
var _loc6_:uint = 0;
var _loc7_:int = 0;
this.pixels = param1;
this.overpixels = param2;
var _loc3_:Array = new Array();
mpixels = param1.clone();
var _loc4_:int = 0;
while(_loc4_ < param1.height)
{
_loc5_ = 0;
while(_loc5_ < param1.width)
{
_loc6_ = getLayerTile(_loc5_,_loc4_,true);
_loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_);
_loc3_.push(_loc7_);
_loc5_++;
}
_loc4_++;
}
return _loc3_;
}
override public function draw() : void
{
super.draw();
if(_complete && this._gameOver != null)
{
this._gameOver.draw();
}
}
override protected function calcTop(param1:int) : int
{
return 0;
}
override protected function calcBottom(param1:int) : int
{
return pixels.height;
}
override public function setBoss(param1:int) : void
{
boss = 2;
bossHeight = param1;
}
}
}
@@ -0,0 +1,78 @@
package com.arc.dh.state
{
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 BossModeTooltip extends Tooltip
{
private static const spriteTooltipArrow:Class = BossModeTooltip_spriteTooltipArrow;
private static const TOOLTIP_WIDTH:int = 120;
private static const TOOLTIP_TEXT_WIDTH:int = 112;
public var bsource:ArcButton = null;
private var _contents:ArcGroup = new ArcGroup();
public function BossModeTooltip(param1:Number, param2:Number, param3:int)
{
var _loc6_:FlxBitmapText = null;
var _loc4_:int = param1 - TOOLTIP_WIDTH / 2;
if(_loc4_ < 10)
{
_loc4_ = 10;
}
else if(_loc4_ + TOOLTIP_WIDTH > FlxG.width - 10)
{
_loc4_ = FlxG.width - TOOLTIP_WIDTH - 10;
}
super(_loc4_,param2);
var _loc5_:int = 5;
if(param3 == 1 && Data.boss[0] == 0)
{
_loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"COMPLETE NORMAL BOSS RUSH TO UNLOCK HEROIC BOSS RUSH","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc6_);
_loc5_ += _loc6_.height + 1;
}
else
{
_loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"BOSS RUSH: " + (param3 == 0 ? "NORMAL" : "HEROIC"),"center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc6_);
_loc5_ += _loc6_.height + 1;
_loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_BLACK),"BEST TIME: " + Data.duration(0,Data.boss[param3 == 1 ? 3 : 1]),"center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc6_);
_loc5_ += _loc6_.height + 1;
_loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"TIMES COMPLETED: " + Data.boss[param3 == 1 ? 2 : 0],"center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc6_);
_loc5_ += _loc6_.height + 1;
if(param3 == 1)
{
_loc5_ += 6;
_loc6_ = new FlxBitmapText(4,_loc5_,Fonts.font(Fonts.OUTLINE_GRADIENT),"WARNING: VERY DIFFICULT","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc6_);
_loc5_ += _loc6_.height + 1;
}
}
_loc5_ += 1;
var _loc7_:int = _loc5_ + 2;
var _loc8_:int = param1 - _loc4_ - 8;
var _loc9_:ArcSprite = new ArcSprite(_loc8_,_loc7_ - 2);
_loc9_.loadGraphic(spriteTooltipArrow,false,true,17,10);
this._contents.add(_loc9_);
createBackground(TOOLTIP_WIDTH,_loc7_);
this.add(this._contents);
this._contents.setAll("scrollFactor",new FlxPoint(0,0));
shift(this._contents,0,-_loc7_ - 5);
shift(_background,0,-_loc7_ - 5);
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/68.png")]
public class BossModeTooltip_spriteTooltipArrow extends BitmapAsset
{
public function BossModeTooltip_spriteTooltipArrow()
{
super();
}
}
}
@@ -0,0 +1,123 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
import com.arc.dh.util.Fonts;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcButtonGroup;
import org.flixel.FlxBitmapText;
import org.flixel.FlxG;
public class BossScreen extends MenuScreen
{
private static const buttonBackSprite:Class = BossScreen_buttonBackSprite;
private static const buttonNormalSprite:Class = BossScreen_buttonNormalSprite;
private static const buttonHeroicSprite:Class = BossScreen_buttonHeroicSprite;
private static const buttonHeroicLockedSprite:Class = BossScreen_buttonHeroicLockedSprite;
private var _buttonBack:ArcButton;
private var _buttonNormal:ArcButton;
private var _buttonHeroic:ArcButton;
public var tooltip:BossModeTooltip;
public var hovering:Boolean = false;
public function BossScreen(param1:MainMenu)
{
var abg:ArcButtonGroup;
var i:int;
var heroicUnlocked:Boolean = false;
var bb:BossButton = null;
var M:MainMenu = param1;
super(M);
this.add(new InstructionWindow(0,100,FlxG.width,70));
this.add(new FlxBitmapText(10,104,Fonts.font(Fonts.OUTLINE_GRADIENT),"FACE OFF AGAINST ONE BOSS AFTER ANOTHER IN AN ATTEMPT TO TAKE DOWN THE PROFESSOR\'S MOST POWERFUL CONSTRUCTS. IF YOU MANAGE TO DEFEAT THEM ALL, YOU WILL EARN HEROIC BOSS RUSH, A CHANCE TO TAKE ON A MUCH STRONGER AND MORE ADVANCED VERSION OF EACH BOSS.","center",FlxG.width - 20));
this._buttonNormal = new ArcButton(85,141,87,26,buttonNormalSprite).callback(function():void
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new BossMode(false));
});
}).selectable(false);
this.add(this._buttonNormal);
heroicUnlocked = Data.boss[0] > 0;
this._buttonHeroic = new ArcButton(185,141,87,26,heroicUnlocked ? buttonHeroicSprite : buttonHeroicLockedSprite).callback(function():void
{
SoundSystem.fadeOutMusic();
if(heroicUnlocked)
{
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new BossMode(true));
});
}
}).selectable(false);
this.add(this._buttonHeroic);
this._buttonBack = new ArcButton(135,213,87,26,buttonBackSprite).callback(function():void
{
menu.switchScreen(menu.mainScreen);
}).selectable(false);
this.add(this._buttonBack);
this.add(new InstructionWindow(0,180,FlxG.width,30));
this.add(new FlxBitmapText(9,183,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"PRACTICE SINGLE BOSS:","left",150));
this.add(new FlxBitmapText(9,183,Fonts.font(Fonts.OUTLINE_BLACK_S),"SHIFT CLICK FOR HEROIC ONCE UNLOCKED","right",FlxG.width - 20));
abg = new ArcButtonGroup();
i = 0;
while(i < 7)
{
bb = new BossButton(8 + i * 50,191,i);
bb.setScreen(this);
this.add(bb);
i++;
}
}
override public function update() : void
{
var _loc2_:ArcButton = null;
super.update();
var _loc1_:Array = [this._buttonNormal,this._buttonHeroic];
for each(_loc2_ in _loc1_)
{
if(_loc2_.hover())
{
if(this.tooltip == null || this.tooltip.bsource != _loc2_)
{
this.tooltip = new BossModeTooltip(_loc2_.x + 43,_loc2_.y,_loc2_ == this._buttonNormal ? 0 : 1);
this.tooltip.bsource = _loc2_;
}
this.hovering = true;
}
}
if(FlxG.keys.justPressed("ESCAPE"))
{
menu.switchScreen(menu.mainScreen);
}
if(!this.hovering && this.tooltip != null)
{
this.tooltip = null;
}
this.hovering = false;
}
override public function draw() : void
{
super.draw();
if(this.tooltip != null)
{
this.tooltip.draw();
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/56.png")]
public class BossScreen_buttonBackSprite extends BitmapAsset
{
public function BossScreen_buttonBackSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/288_com.arc.dh.state.BossScreen_buttonHeroicLockedSprite.png")]
public class BossScreen_buttonHeroicLockedSprite extends BitmapAsset
{
public function BossScreen_buttonHeroicLockedSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/284_com.arc.dh.state.BossScreen_buttonHeroicSprite.png")]
public class BossScreen_buttonHeroicSprite extends BitmapAsset
{
public function BossScreen_buttonHeroicSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/290_com.arc.dh.state.BossScreen_buttonNormalSprite.png")]
public class BossScreen_buttonNormalSprite extends BitmapAsset
{
public function BossScreen_buttonNormalSprite()
{
super();
}
}
}
@@ -0,0 +1,104 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
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;
public class Chapter extends ArcGroup
{
private static const sprite:Class = Chapter_sprite;
public static const badgesSprite:Class = Chapter_badgesSprite;
private static const FRAMES_PER_CHAPTER:int = 4;
private var _chapter:int;
private var _locked:Boolean;
private var _text:FlxBitmapText;
private var _image:ArcSprite;
private var _bar:ArcSprite;
private var _badge:ArcSprite;
public function Chapter(param1:int)
{
super(9 + param1 * 50,150);
this._chapter = param1 + 1;
this._locked = this._chapter > 1 && Data.chapters[param1 - 1][0] == 0;
this._image = new ArcSprite(0,0);
this._image.loadGraphic(sprite,true,false,39,39);
this._image.addAnimation("idle",[FRAMES_PER_CHAPTER * param1]);
this._image.addAnimation("hover",[FRAMES_PER_CHAPTER * param1 + 1]);
this._image.addAnimation("locked",[FRAMES_PER_CHAPTER * param1 + 2]);
this._image.addAnimation("locked_hover",[FRAMES_PER_CHAPTER * param1 + 3]);
this._image.play("idle");
this.add(this._image);
this._text = new FlxBitmapText(-4,-5,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"CHAPTER " + (param1 + 1),"center",49,true);
this.add(this._text);
this._bar = new ArcSprite(1,43);
this._bar.makeGraphic(37,4,2566914048);
this.add(this._bar);
this._badge = new ArcSprite(11,40);
this._badge.loadGraphic(badgesSprite,true,false,16,9);
this._badge.addAnimation("badge",[Data.chapters[param1][1] == 0 ? 4 : Data.chapters[param1][1]]);
this._badge.play("badge");
this.add(this._badge);
this.update();
}
public function hover() : Boolean
{
return this._image.hover();
}
public function getX() : int
{
return this._image.x + this._image.width / 2;
}
public function getY() : int
{
return this._image.y - 1;
}
override public function update() : void
{
if(this._image.hover())
{
if(this._image.animation != "locked_hover" && this._image.animation != "hover")
{
SoundSystem.play(Sound.MENU_SELECT);
}
this._image.play(this._locked ? "locked_hover" : "hover");
if(FlxG.mouse.justPressed())
{
if(!this._locked)
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new StoryMode(_chapter));
});
}
}
}
else
{
this._image.play(this._locked ? "locked" : "idle");
}
super.update();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/179_com.arc.dh.state.Chapter_badgesSprite.png")]
public class Chapter_badgesSprite extends BitmapAsset
{
public function Chapter_badgesSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/300_com.arc.dh.state.Chapter_sprite.png")]
public class Chapter_sprite extends BitmapAsset
{
public function Chapter_sprite()
{
super();
}
}
}
@@ -0,0 +1,98 @@
package com.arc.dh.state
{
import com.arc.dh.util.Config;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcSprite;
import flash.events.MouseEvent;
import org.flixel.FlxG;
import org.flixel.FlxU;
public class CreditsScreen extends MenuScreen
{
private static const sprite:Class = CreditsScreen_sprite;
private static const buttonHomepageSprite:Class = CreditsScreen_buttonHomepageSprite;
private var _credits:ArcSprite;
private var _buttonBack:ArcButton;
private var _buttonPegas:ArcButton;
private var _homepageButton:ArcButton;
public function CreditsScreen(param1:MainMenu)
{
var M:MainMenu = param1;
super(M);
this._buttonBack = new ArcButton(265,210,87,26,StoryScreen.buttonBackSprite).callback(function():void
{
menu.switchScreen(menu.mainScreen);
}).selectable(false);
this.add(this._buttonBack);
this._homepageButton = new ArcButton(2,91,40,28,buttonHomepageSprite).callback(function():void
{
FlxU.openURL("http://iarke.us");
}).selectable(false);
this.add(this._homepageButton);
if(Config.RELEASE == Config.PEGAS)
{
this._buttonPegas = new ArcButton(245,90,106,46,MainScreen.buttonPegas).callback(function():void
{
}).selectable(false);
this.add(this._buttonPegas);
}
else if(Config.RELEASE == Config.ARMORGAMES)
{
this._buttonPegas = new ArcButton(215,90,133,39,MainScreen.buttonAG).callback(function():void
{
FlxU.openURL("http://armorgames.com");
}).selectable(false);
this.add(this._buttonPegas);
}
this._credits = new ArcSprite(0,0,sprite);
this.add(this._credits);
}
public function bindPegas() : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegasCredits);
}
public function unbindPegas() : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegasCredits);
}
private function pegasCredits(param1:*) : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
if(this._buttonPegas.hover())
{
FlxU.openURL("http://www.pegasgames.com/");
}
}
override public function update() : void
{
if(FlxG.keys.justPressed("ESCAPE"))
{
menu.switchScreen(menu.mainScreen);
}
super.update();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/186_com.arc.dh.state.CreditsScreen_buttonHomepageSprite.png")]
public class CreditsScreen_buttonHomepageSprite extends BitmapAsset
{
public function CreditsScreen_buttonHomepageSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/87_com.arc.dh.state.CreditsScreen_sprite.png")]
public class CreditsScreen_sprite extends BitmapAsset
{
public function CreditsScreen_sprite()
{
super();
}
}
}
@@ -0,0 +1,112 @@
package com.arc.dh.state
{
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.flixel.ArcButton;
import com.arc.flixel.ArcButtonGroup;
import com.arc.flixel.ArcGroup;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxBitmapText;
public class EscapeButton extends ArcGroup
{
private static const buttonSprite:Class = EscapeButton_buttonSprite;
public static const lockSprite:Class = EscapeButton_lockSprite;
private var _height:int;
private var _button:ArcButton;
private var _text:FlxBitmapText;
private var _lock:ArcSprite;
private var _screen:EscapeScreen;
public function EscapeButton(param1:Number, param2:Number, param3:int, param4:ArcButtonGroup)
{
var index:int = 0;
var cost:int = 0;
var X:Number = param1;
var Y:Number = param2;
var H:int = param3;
var G:ArcButtonGroup = param4;
super();
this._height = H;
this._button = new ArcButton(X,Y,42,16,buttonSprite);
this.add(this._button);
G.addButton(this._button);
this._text = new FlxBitmapText(X,Y + 4,Fonts.font(Fonts.OUTLINE_BLACK_S),H + "M","right",37);
this.add(this._text);
index = H / 100;
cost = H * 5;
if(Data.escape[index] == 0)
{
this._lock = new ArcSprite(X + 4,Y + 3,lockSprite);
this._button.selectable(false).callback(function():void
{
if(Data.diamonds >= cost && Data.escape[index - 1] == 1)
{
Data.escape[index] = 1;
_lock = null;
_screen.tooltip = null;
_button.callback(null);
_button.selectable(true);
_button.select();
Data.diamonds -= cost;
AchievementSystem.checkpoints();
DataSerializer.save();
}
});
}
else
{
this._button.selectable(true);
this._button.select();
}
}
public function setScreen(param1:EscapeScreen) : void
{
this._screen = param1;
}
override public function update() : void
{
if(this._button.hover() && this._lock != null)
{
if(this._screen.tooltip == null || this._screen.tooltip.source != this)
{
this._screen.tooltip = new EscapeTooltip(this._button.x + 21,this._button.y,this._height);
this._screen.tooltip.source = this;
}
this._screen.hovering = true;
}
super.update();
}
override public function draw() : void
{
super.draw();
if(this._lock != null)
{
this._lock.draw();
}
}
public function get selected() : Boolean
{
return this._button.selected;
}
public function get start() : int
{
return this._height;
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/124.png")]
public class EscapeButton_buttonSprite extends BitmapAsset
{
public function EscapeButton_buttonSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/270.png")]
public class EscapeButton_lockSprite extends BitmapAsset
{
public function EscapeButton_lockSprite()
{
super();
}
}
}
@@ -0,0 +1,435 @@
package com.arc.dh.state
{
import Playtomic.Log;
import com.arc.dh.entities.Player;
import com.arc.dh.menu.GameOver;
import com.arc.dh.objects.*;
import com.arc.dh.util.AchievementSystem;
import com.arc.dh.util.Config;
import com.arc.dh.util.Data;
import com.arc.dh.util.DataSerializer;
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 flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import org.flixel.FlxG;
import org.flixel.FlxObject;
import org.flixel.FlxPoint;
import org.flixel.FlxTilemap;
import org.flixel.system.FlxTile;
public class EscapeMode extends PlayMode
{
protected static const ESCAPE_SPRITE:Class = EscapeMode_ESCAPE_SPRITE;
protected static const ESCAPE_OVERLAY_SPRITE:Class = EscapeMode_ESCAPE_OVERLAY_SPRITE;
protected static const LAVA_SPRITE:Class = EscapeMode_LAVA_SPRITE;
private static const ESCAPE_HEIGHT:int = 2000;
private static const ESCAPE_WIDTH:int = 30;
private static const BOTTOM_PADDING:int = 1;
private static const PLATFORM_SIZE:int = 3;
private static const LAVA_TELEPORT_DISTANCE:int = 220;
private var sourcePixels:BitmapData;
private var sourceOverlayPixels:BitmapData;
private var chunks:Array;
private var lavaStarted:Boolean;
private var lava:ArcSprite;
private var _gameOver:GameOver;
public function EscapeMode(param1:int)
{
super();
mode = ESCAPE_MODE;
this.sourcePixels = new ArcSprite(0,0,ESCAPE_SPRITE).pixels;
this.sourceOverlayPixels = new ArcSprite(0,0,ESCAPE_OVERLAY_SPRITE).pixels;
startHeight = param1;
_ch = ArcU.rand(1,7);
}
override public function create() : void
{
super.create();
Log.CustomMetric("EndlessStart","Modes");
spawnChance = 50;
this.lava = new ArcSprite(0,80,LAVA_SPRITE);
this.lava.y = player.y + 24;
this.lava.velocity.y = -5;
lavagroup.add(this.lava);
StoryMode.storyMusic(_ch);
}
override public function update() : void
{
var _loc2_:Boolean = false;
if(_complete)
{
this._gameOver.update();
showAchievement();
return;
}
super.update();
if(inMenu)
{
return;
}
var _loc1_:int = caveHeight;
if(_loc1_ >= 1)
{
if(_loc1_ < 1000)
{
spawnChance = 50 + 50 * (_loc1_ / 1000);
}
else
{
spawnChance = 100;
}
}
if(FlxG.keys.justPressed("R"))
{
FlxG.switchState(new EscapeMode(0));
}
if(this.lavaStarted)
{
if(_loc1_ < 50)
{
this.lava.velocity.y = -5;
}
else
{
this.lava.velocity.y = (_loc1_ - 50) / -30 - 5;
}
if(this.lava.velocity.y < -60)
{
this.lava.velocity.y = -60;
}
}
else
{
this.lava.velocity.y = -5;
if(player.y < tilemap.height - 80 && Boolean(player.touching & FlxObject.DOWN))
{
this.lavaStarted = true;
}
}
if(this.lava.getScreenXY().y < -20)
{
this.lava.y = FlxG.camera.scroll.y - 20;
}
if(this.lava.y > player.y + LAVA_TELEPORT_DISTANCE)
{
this.lava.y = player.y + LAVA_TELEPORT_DISTANCE;
}
else if(this.lava.y < player.y)
{
if(Data.moltensuit == 0 || !player.lastHitLava)
{
player.invulnerable = 0;
}
_loc2_ = false;
if(!player.shielded)
{
if(Data.moltensuit == 0 || !player.lastHitLava)
{
player.invulnerable = 0;
}
_loc2_ = player.hit(100,false,true,false,true);
}
if(Data.hp <= 0)
{
AchievementSystem.lava();
}
if(_loc2_)
{
if(Data.moltensuit == 1)
{
player.invulnerable = 1.5;
}
else
{
player.invulnerable = 0;
}
}
player.inWater();
}
}
override protected function createLevel() : void
{
this.chunks = this.buildChunks();
tilemap = this.buildLevel();
tilemap.follow();
}
override public function die() : void
{
_complete = true;
inMenu = false;
SoundSystem.play(Sound.WIN);
this._gameOver = new GameOver(cdiamonds.toString(),caveHeight.toString() + "M",duration).setCallback(function():void
{
FlxG.mouse.hide();
FlxG.switchState(new EscapeMode(startHeight));
},function():void
{
FlxG.mouse.hide();
FlxG.switchState(new MainMenu(1));
});
Log.LevelAverageMetric("EndlessHeight",1,caveHeight);
++Data.deaths;
DataSerializer.save();
Data.kong();
Newgrounds.medals();
}
override public function reset() : void
{
}
override public function restart() : void
{
var _loc2_:StoryDialog = null;
var _loc1_:Array = checkpoints[checkpoints.length - 1];
player.reset(_loc1_[0] * Config.BLOCK_SIZE + 4,_loc1_[1] * Config.BLOCK_SIZE + 12);
FlxG.camera.focusOn(new FlxPoint(player.x,player.y));
FlxG.camera.follow(player);
Data.hp = Data.hpm;
boss = 0;
spawner = new Object();
pixels = mpixels.clone();
for each(_loc2_ in messages)
{
_loc2_.load();
}
bullets.clear();
enemies.clear();
penemies.clear();
diamonds.clear();
powerups.clear();
damagetexts.clear();
healthbars.clear();
objects.clear();
cobjects.clear();
spawnTop = calcTop(Config.SPAWN_PADDING);
spawnBottom = calcBottom(Config.SPAWN_PADDING);
despawnTop = player.y / Config.BLOCK_SIZE;
despawnBottom = player.y / Config.BLOCK_SIZE + 1;
}
private function buildLevel() : FlxTilemap
{
var waterFunction:Function;
var map:FlxTilemap = null;
var tileArray:Array = this.createRandomMap();
var tileCSV:String = FlxTilemap.arrayToCSV(tileArray,Config.BLOCK_WIDTH);
map = new FlxTilemap();
map.loadMap(tileCSV,PlayMode["T" + _ch],Config.BLOCK_SIZE,Config.BLOCK_SIZE,0,0,1,80);
map.setTileProperties(52,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void
{
var _loc3_:int = 0;
if(param2 is Bullet)
{
ArcParticleSystem.emit(Data.state.particles,"wooden_crate",param1.x,param1.y,10,1,5,400,-100,100,-100,-40,param1.width,param1.height);
map.setTileByIndex(param1.mapIndex,0,true);
_loc3_ = ArcU.rand(0,100);
if(_loc3_ >= 80)
{
if(_loc3_ < 99)
{
addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch));
}
else
{
createHeart(param1.x,param1.y);
}
}
++Data.boxes;
SoundSystem.play(Sound.BOX,0.4);
AchievementSystem.boxes();
}
});
map.setTileProperties(53,FlxObject.ANY,function(param1:FlxTile, param2:FlxObject):void
{
var _loc3_:int = 0;
if(param2 is Missile)
{
ArcParticleSystem.emit(Data.state.particles,"steel_crate",param1.x,param1.y,10,1,5,800,-100,100,-200,-80,param1.width,param1.height);
map.setTileByIndex(param1.mapIndex,0,true);
_loc3_ = ArcU.rand(0,100);
if(_loc3_ >= 50)
{
if(_loc3_ < 99)
{
addDiamonds(param1.x,param1.y,ArcU.rand(1,2 * _ch));
}
else
{
createHeart(param1.x,param1.y);
}
}
++Data.boxes;
SoundSystem.play(Sound.STEELBOX);
AchievementSystem.boxes();
}
});
waterFunction = function(param1:FlxTile, param2:FlxObject):void
{
var _loc3_:Player = param2 as Player;
if(_loc3_ == null)
{
return;
}
_loc3_.inWater();
};
map.setTileProperties(12,FlxObject.NONE,waterFunction,Player);
map.setTileProperties(56,FlxObject.ANY);
return map;
}
private function imageToTileArray(param1:BitmapData, param2:BitmapData) : Array
{
var _loc5_:int = 0;
var _loc6_:uint = 0;
var _loc7_:int = 0;
this.pixels = param1;
this.overpixels = param2;
var _loc3_:Array = new Array();
mpixels = param1.clone();
var _loc4_:int = 0;
while(_loc4_ < param1.height)
{
_loc5_ = 0;
while(_loc5_ < param1.width)
{
_loc6_ = getLayerTile(_loc5_,_loc4_,true);
_loc7_ = colorToTileID(_loc6_,_loc5_,_loc4_);
_loc3_.push(_loc7_);
_loc5_++;
}
_loc4_++;
}
return _loc3_;
}
private function createRandomMap() : Array
{
var _loc10_:Array = null;
var _loc11_:Array = null;
var _loc12_:int = 0;
var _loc13_:int = 0;
var _loc14_:int = 0;
var _loc15_:int = 0;
var _loc16_:uint = 0;
var _loc1_:int = 0;
var _loc2_:int = 0;
var _loc3_:int = 0;
var _loc4_:int = ESCAPE_HEIGHT;
var _loc5_:int = 0;
var _loc6_:Array = new Array();
while(_loc5_ < _loc4_)
{
_loc11_ = this.chunks[ArcU.rand(0,this.chunks.length - 1)] as Array;
_loc6_.push(_loc11_);
_loc5_ += _loc11_[1] as int;
}
var _loc7_:int = _loc5_ + BOTTOM_PADDING + PLATFORM_SIZE;
var _loc8_:BitmapData = new BitmapData(ESCAPE_WIDTH,_loc7_,false);
var _loc9_:BitmapData = new BitmapData(ESCAPE_WIDTH,_loc7_,false);
for each(_loc10_ in _loc6_)
{
_loc12_ = _loc10_[0] as int;
_loc13_ = _loc10_[1] as int;
if(ArcU.rand(0,1) == 0)
{
_loc8_.copyPixels(this.sourcePixels,new Rectangle(1,_loc12_,ESCAPE_WIDTH,_loc13_),new Point(0,_loc1_));
}
else
{
_loc14_ = 0;
while(_loc14_ < _loc13_)
{
_loc15_ = 0;
while(_loc15_ <= ESCAPE_WIDTH)
{
_loc16_ = this.sourcePixels.getPixel(_loc15_,_loc14_ + _loc12_);
if(_loc16_ == 7766374)
{
_loc16_ = 5069370;
}
else if(_loc16_ == 5069370)
{
_loc16_ = 7766374;
}
_loc8_.setPixel(ESCAPE_WIDTH - _loc15_,_loc14_ + _loc1_,_loc16_);
_loc15_++;
}
_loc14_++;
}
}
_loc1_ += _loc13_;
}
_loc2_ = 2;
while(_loc2_ < ESCAPE_WIDTH - 2)
{
_loc3_ = _loc7_ - PLATFORM_SIZE;
while(_loc3_ < _loc7_)
{
_loc8_.setPixel(_loc2_,_loc3_,_loc3_ == _loc7_ - PLATFORM_SIZE ? 5228053 : 10052885);
_loc9_.setPixel(_loc2_,_loc3_,16777215);
_loc3_++;
}
_loc2_++;
}
return this.imageToTileArray(_loc8_,_loc9_);
}
private function buildChunks() : Array
{
var _loc4_:uint = 0;
var _loc1_:Array = new Array();
var _loc2_:int = -1;
var _loc3_:int = 0;
while(_loc3_ < this.sourcePixels.height)
{
_loc4_ = this.sourcePixels.getPixel(0,_loc3_);
if(_loc4_ == 16711920)
{
if(_loc2_ != -1)
{
_loc1_.push([_loc2_,_loc3_ - _loc2_]);
}
_loc2_ = _loc3_;
}
_loc3_++;
}
_loc1_.push([_loc2_,_loc3_ - _loc2_]);
return _loc1_;
}
override public function draw() : void
{
super.draw();
if(_complete && this._gameOver != null)
{
this._gameOver.draw();
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/54.png")]
public class EscapeMode_ESCAPE_OVERLAY_SPRITE extends BitmapAsset
{
public function EscapeMode_ESCAPE_OVERLAY_SPRITE()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/88.png")]
public class EscapeMode_ESCAPE_SPRITE extends BitmapAsset
{
public function EscapeMode_ESCAPE_SPRITE()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/171.png")]
public class EscapeMode_LAVA_SPRITE extends BitmapAsset
{
public function EscapeMode_LAVA_SPRITE()
{
super();
}
}
}
@@ -0,0 +1,123 @@
package com.arc.dh.state
{
import com.arc.dh.util.Config;
import com.arc.dh.util.Data;
import com.arc.dh.util.Fonts;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcButtonGroup;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxBitmapText;
import org.flixel.FlxG;
public class EscapeScreen extends MenuScreen
{
private static const buttonBackSprite:Class = EscapeScreen_buttonBackSprite;
private static const startBackSprite:Class = EscapeScreen_startBackSprite;
private static const escapeSprite:Class = EscapeScreen_escapeSprite;
public static const diamondsSprite:Class = EscapeScreen_diamondsSprite;
private var _escapeImage:ArcSprite;
private var _buttonBack:ArcButton;
private var _buttonStart:ArcButton;
public var tooltip:EscapeTooltip;
public var hovering:Boolean = false;
public var buttons:Array;
private var _diamondsText:FlxBitmapText;
public function EscapeScreen(param1:MainMenu)
{
var startHeight:FlxBitmapText;
var abg:ArcButtonGroup;
var i:int;
var _diamonds:ArcSprite;
var maxHeight:FlxBitmapText;
var eb:EscapeButton = null;
var M:MainMenu = param1;
this.buttons = new Array();
super(M);
this._buttonBack = new ArcButton(185,208,87,26,buttonBackSprite).callback(function():void
{
menu.switchScreen(menu.mainScreen);
}).selectable(false);
this.add(this._buttonBack);
this._buttonStart = new ArcButton(85,208,87,26,startBackSprite).callback(function():void
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
var _loc2_:* = undefined;
var _loc1_:* = 0;
for each(_loc2_ in buttons)
{
if(_loc2_.selected)
{
_loc1_ = _loc2_.start;
}
}
FlxG.mouse.hide();
FlxG.switchState(new EscapeMode(_loc1_));
});
}).selectable(false);
this.add(this._buttonStart);
this._escapeImage = new ArcSprite(0,108,escapeSprite);
this.add(this._escapeImage);
this.add(new InstructionWindow(0,170,FlxG.width,30));
startHeight = new FlxBitmapText(2,177,Fonts.font(Fonts.OUTLINE_BLACK_S),"STARTING HEIGHT:","center",77);
this.add(startHeight);
abg = new ArcButtonGroup();
i = 0;
while(i < 6)
{
eb = new EscapeButton(85 + i * 46,177,i * 100,abg);
eb.setScreen(this);
this.add(eb);
this.buttons.push(eb);
i++;
}
_diamonds = new ArcSprite(4,Config.HEIGHT - 14);
_diamonds.loadGraphic(diamondsSprite,true,false,44,12);
this.add(_diamonds);
this._diamondsText = new FlxBitmapText(4,Config.HEIGHT - 11,Fonts.font(Fonts.SMALL_WHITE),Data.diamonds > 99999 ? "99999" : Data.diamonds.toString(),"right",40);
this.add(this._diamondsText);
maxHeight = new FlxBitmapText(2,186,Fonts.font(Fonts.OUTLINE_GRADIENT_S),"MAX: " + Data.maxheight + "M","center",77);
this.add(maxHeight);
this.update();
}
override public function update() : void
{
super.update();
if(FlxG.keys.justPressed("ESCAPE"))
{
menu.switchScreen(menu.mainScreen);
}
this._diamondsText.text = Data.diamonds > 99999 ? "99999" : Data.diamonds.toString();
if(!this.hovering && this.tooltip != null)
{
this.tooltip = null;
}
this.hovering = false;
}
override public function draw() : void
{
super.draw();
if(this.tooltip != null)
{
this.tooltip.draw();
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/56.png")]
public class EscapeScreen_buttonBackSprite extends BitmapAsset
{
public function EscapeScreen_buttonBackSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/151_com.arc.dh.state.EscapeScreen_diamondsSprite.png")]
public class EscapeScreen_diamondsSprite extends BitmapAsset
{
public function EscapeScreen_diamondsSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/164_com.arc.dh.state.EscapeScreen_escapeSprite.png")]
public class EscapeScreen_escapeSprite extends BitmapAsset
{
public function EscapeScreen_escapeSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/59_com.arc.dh.state.EscapeScreen_startBackSprite.png")]
public class EscapeScreen_startBackSprite extends BitmapAsset
{
public function EscapeScreen_startBackSprite()
{
super();
}
}
}
@@ -0,0 +1,69 @@
package com.arc.dh.state
{
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 EscapeTooltip extends Tooltip
{
private static const spriteTooltipArrow:Class = EscapeTooltip_spriteTooltipArrow;
private static const TOOLTIP_WIDTH:int = 120;
private static const TOOLTIP_TEXT_WIDTH:int = 112;
private var _contents:ArcGroup = new ArcGroup();
public function EscapeTooltip(param1:Number, param2:Number, param3:int)
{
var _loc7_:FlxBitmapText = null;
var _loc4_:int = param1 - TOOLTIP_WIDTH / 2;
if(_loc4_ < 10)
{
_loc4_ = 10;
}
else if(_loc4_ + TOOLTIP_WIDTH > FlxG.width - 10)
{
_loc4_ = FlxG.width - TOOLTIP_WIDTH - 10;
}
var _loc5_:int = param3 / 100;
super(_loc4_,param2);
var _loc6_:int = 5;
_loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),param3 + "M CHECKPOINT","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc7_);
_loc6_ += _loc7_.height + 1;
_loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_BLACK),"COST: " + param3 * 5 + " DIAMONDS","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc7_);
_loc6_ += _loc7_.height + 1;
if(Data.escape[_loc5_ - 1] == 1)
{
_loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),"CLICK TO BUY","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc7_);
_loc6_ += _loc7_.height;
}
else
{
_loc7_ = new FlxBitmapText(4,_loc6_,Fonts.font(Fonts.OUTLINE_GRADIENT),"REQUIRES " + (param3 - 100) + " CHECKPOINT","center",TOOLTIP_TEXT_WIDTH);
this._contents.add(_loc7_);
_loc6_ += _loc7_.height;
}
_loc6_ += 2;
var _loc8_:int = _loc6_ + 2;
var _loc9_:int = param1 - _loc4_ - 8;
var _loc10_:ArcSprite = new ArcSprite(_loc9_,_loc8_ - 2);
_loc10_.loadGraphic(spriteTooltipArrow,false,true,17,10);
this._contents.add(_loc10_);
createBackground(TOOLTIP_WIDTH,_loc8_);
this.add(this._contents);
this._contents.setAll("scrollFactor",new FlxPoint(0,0));
shift(this._contents,0,-_loc8_ - 5);
shift(_background,0,-_loc8_ - 5);
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/68.png")]
public class EscapeTooltip_spriteTooltipArrow extends BitmapAsset
{
public function EscapeTooltip_spriteTooltipArrow()
{
super();
}
}
}
@@ -0,0 +1,196 @@
package com.arc.dh.state
{
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.errors.IOError;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import flash.system.Security;
import org.flixel.*;
public class FlxKongregate
{
public static var api:*;
private static var apiLoader:Loader;
private static var loadCallback:Function;
public static var hasLoaded:Boolean = false;
public static var isLocal:Boolean = false;
private static var shadowAPI:String = "http://www.kongregate.com/flash/API_AS3_Local.swf";
public function FlxKongregate()
{
super();
}
public static function init(param1:Function) : void
{
var apiPath:String = null;
var parameters:Object = null;
var callback:Function = param1;
try
{
parameters = FlxG.stage.loaderInfo.parameters;
}
catch(e:Error)
{
throw new Error("FlxKongregate: No access to FlxG.stage - only call this once your game has access to the display list");
}
if(parameters.kongregate_api_path)
{
Security.allowDomain(parameters.kongregate_api_path);
apiPath = parameters.kongregate_api_path;
}
else
{
Security.allowDomain(shadowAPI);
apiPath = shadowAPI;
isLocal = true;
}
loadCallback = callback;
apiLoader = new Loader();
apiLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,apiLoadComplete,false,0,true);
apiLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,apiLoadError,false,0,true);
apiLoader.load(new URLRequest(apiPath));
FlxG.stage.addChild(apiLoader);
}
public static function disconnect() : void
{
api = null;
hasLoaded = false;
FlxG.stage.removeChild(apiLoader);
}
private static function apiLoadComplete(param1:Event) : void
{
api = param1.target.content;
hasLoaded = true;
Security.allowDomain(api.loaderInfo.url);
if(loadCallback is Function)
{
loadCallback.call();
}
}
private static function apiLoadError(param1:IOError) : void
{
}
public static function addLoadListener(param1:String, param2:Function) : void
{
api.sharedContent.addLoadListener(param1,param2);
}
public static function addEventListener(param1:String, param2:Function) : void
{
api.services.addEventListener(param1,param2);
}
public static function connect() : void
{
if(hasLoaded)
{
api.services.connect();
}
}
public static function get isGuest() : Boolean
{
return api.services.isGuest();
}
public static function get getUserName() : String
{
return api.services.getUsername();
}
public static function get getUserId() : Number
{
try
{
return api.services.getUserId();
}
catch(e:Error)
{
return 0;
}
}
public static function get getGameAuthToken() : String
{
return api.services.getGameAuthToken();
}
public static function showSignInBox() : void
{
if(api.services.isGuest())
{
api.services.showSignInBox();
}
}
public static function showRegistrationBox() : void
{
if(api.services.isGuest())
{
api.services.showRegistrationBox();
}
}
public static function showShoutBox(param1:String = "") : void
{
if(api.services.isGuest() == false)
{
api.services.showShoutBox(param1);
}
}
public static function resizeGame(param1:int, param2:int) : void
{
api.services.resizeGame(param1,param2);
}
public static function submitStats(param1:String, param2:Number) : void
{
api.stats.submit(param1,param2);
}
public static function purchaseItem(param1:Array, param2:Function) : void
{
api.mtx.purchaseItems(param1,param2);
}
public static function requestUserItemList(param1:String, param2:Function) : void
{
api.mtx.requestUserItemList(param1,param2);
}
public static function showKredPurchaseDialog(param1:String) : void
{
api.mtx.showKredPurchaseDialog(param1);
}
public static function browseSharedContent(param1:String, param2:String = null, param3:String = null) : void
{
api.sharedContent.browse(param1,param2,param3);
}
public static function saveSharedContent(param1:String, param2:String, param3:Function, param4:DisplayObject = null, param5:String = null) : void
{
api.sharedContent.save(param1,param2,param3,param4,param5);
}
public static function submitAvatar(param1:DisplayObject, param2:Function) : void
{
api.images.submitAvatar(param1,param2);
}
}
}
@@ -0,0 +1,52 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxSprite;
public class HeartMeter extends ArcSprite
{
public static const heartFull:Class = HeartMeter_heartFull;
public static const heartEmpty:Class = HeartMeter_heartEmpty;
private var empty:FlxSprite;
private var full:FlxSprite;
public function HeartMeter(param1:Number, param2:Number)
{
super(param1,param2);
width = 9;
height = 9;
this.empty = new FlxSprite(0,y,heartEmpty);
this.empty.scrollFactor.x = this.empty.scrollFactor.y = 0;
this.full = new FlxSprite(0,y,heartFull);
this.full.scrollFactor.x = this.full.scrollFactor.y = 0;
}
override public function draw() : void
{
var _loc1_:int = 0;
_loc1_ = 0;
while(_loc1_ < Data.hpm)
{
if(_loc1_ < Data.hp)
{
this.full.x = x + _loc1_ % 10 * width;
this.full.y = y + int(_loc1_ / 10) * height;
this.full.draw();
}
else
{
this.empty.x = x + _loc1_ % 10 * width;
this.empty.y = y + int(_loc1_ / 10) * height;
this.empty.draw();
}
_loc1_++;
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/244_com.arc.dh.state.HeartMeter_heartEmpty.png")]
public class HeartMeter_heartEmpty extends BitmapAsset
{
public function HeartMeter_heartEmpty()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/156_com.arc.dh.state.HeartMeter_heartFull.png")]
public class HeartMeter_heartFull extends BitmapAsset
{
public function HeartMeter_heartFull()
{
super();
}
}
}
@@ -0,0 +1,39 @@
package com.arc.dh.state
{
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxG;
public class HelpScreen extends MenuScreen
{
private static const sprite:Class = HelpScreen_sprite;
private var _help:ArcSprite;
private var _buttonBack:ArcButton;
public function HelpScreen(param1:MainMenu)
{
var M:MainMenu = param1;
super(M);
this._buttonBack = new ArcButton(135,210,87,26,StoryScreen.buttonBackSprite).callback(function():void
{
menu.switchScreen(menu.mainScreen);
}).selectable(false);
this.add(this._buttonBack);
this._help = new ArcSprite(0,0,sprite);
this.add(this._help);
}
override public function update() : void
{
if(FlxG.keys.justPressed("ESCAPE"))
{
menu.switchScreen(menu.mainScreen);
}
super.update();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/274_com.arc.dh.state.HelpScreen_sprite.png")]
public class HelpScreen_sprite extends BitmapAsset
{
public function HelpScreen_sprite()
{
super();
}
}
}
@@ -0,0 +1,16 @@
package com.arc.dh.state
{
import com.arc.dh.objects.Camera;
public class HorizontalMode extends PlayMode
{
public var camera:Camera;
public function HorizontalMode()
{
super();
}
}
}
@@ -0,0 +1,18 @@
package com.arc.dh.state
{
import com.arc.flixel.ArcGroup;
import com.arc.flixel.ArcSprite;
public class InstructionWindow extends ArcGroup
{
public function InstructionWindow(param1:Number, param2:Number, param3:Number, param4:Number)
{
super(param1,param2);
add(new ArcSprite(0,0).makeGraphic(param3,1,3428464384));
add(new ArcSprite(0,1).makeGraphic(param3,param4 - 2,2583691264));
add(new ArcSprite(0,param4 - 1).makeGraphic(param3,1,3428464384));
}
}
}
@@ -0,0 +1,74 @@
package com.arc.dh.state
{
import Playtomic.Log;
import com.arc.dh.util.Config;
import com.arc.dh.util.Data;
import com.arc.flixel.ArcSprite;
import flash.ui.Mouse;
import mochi.as3.MochiServices;
import org.flixel.FlxG;
import org.flixel.FlxState;
public class Intro extends FlxState
{
private var _logo:ArcSprite;
private var _fader:Number = 0;
public function Intro()
{
super();
}
public static function kong() : void
{
FlxKongregate.connect();
}
override public function create() : void
{
if(Config.externalAPIs())
{
Log.View(Data.GAMEID,Data.GUID,Data.API_KEY,FlxG.root.loaderInfo.loaderURL);
if(Config.RELEASE == Config.PEGAS)
{
MochiBot.track(FlxG.game,"cc6aac2d");
MochiServices.connect("ac9b57453916c20f",FlxG.root,this.onConnectError);
}
FlxKongregate.init(Intro.kong);
Newgrounds.connect();
}
var _loc1_:String = "fc3d1f39c989bd1f";
}
public function onConnectError(param1:String) : void
{
}
override public function update() : void
{
Mouse.hide();
FlxG.mouse.show();
if(Config.RELEASE == Config.PEGAS)
{
FlxG.switchState(new Pegas());
}
else if(Config.RELEASE == Config.ARMORGAMES)
{
FlxG.switchState(new AG());
}
else if(Config.RELEASE == Config.MAXGAMES)
{
FlxG.switchState(new MaxGames());
}
else
{
FlxG.switchState(new MainMenu());
}
this._fader += FlxG.elapsed;
super.update();
}
}
}
@@ -0,0 +1,307 @@
package com.arc.dh.state
{
import com.arc.dh.menu.MenuTooltip;
import com.arc.dh.menu.OptionsMenu;
import com.arc.dh.util.Data;
import com.arc.dh.util.DataSerializer;
import com.arc.dh.util.ParticleSystem;
import com.arc.dh.util.Sound;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcGroup;
import com.arc.flixel.ArcParticleSystem;
import com.arc.flixel.ArcSprite;
import com.arc.flixel.ArcU;
import flash.ui.Mouse;
import org.flixel.FlxG;
import org.flixel.FlxState;
public class MainMenu extends FlxState
{
private static const titleSprite:Class = MainMenu_titleSprite;
private static const titleGlowSprite:Class = MainMenu_titleGlowSprite;
private static const buttonPlay:Class = MainMenu_buttonPlay;
private static const buttonHelp:Class = MainMenu_buttonHelp;
private static const soundButton:Class = MainMenu_soundButton;
protected static const BACKGROUND_SPRITE3:Class = MainMenu_BACKGROUND_SPRITE3;
protected static const BACKGROUND_SPRITE2:Class = MainMenu_BACKGROUND_SPRITE2;
protected static const BACKGROUND_SPRITE1:Class = MainMenu_BACKGROUND_SPRITE1;
protected var bg3:ArcSprite;
protected var bg2:ArcSprite;
protected var bg1:ArcSprite;
protected var title:ArcSprite;
protected var titleGlow:ArcSprite;
protected var titleFadeIn:Boolean = false;
protected var emitters:ArcGroup = new ArcGroup();
protected var screen:MenuScreen;
public var mainScreen:MenuScreen;
public var storyScreen:MenuScreen;
public var escapeScreen:MenuScreen;
public var bossScreen:MenuScreen;
public var helpScreen:MenuScreen;
public var creditsScreen:MenuScreen;
public var minigamesScreen:MenuScreen;
public var _startScreen:int;
public var options:OptionsMenu;
public var inOptions:Boolean = false;
protected var fader:ArcSprite;
protected var faderStatus:int = 0;
public var tooltip:Tooltip;
public var hovering:Boolean = false;
public function MainMenu(param1:int = 0)
{
super();
this._startScreen = param1;
}
override public function create() : void
{
this.mainScreen = new MainScreen(this);
this.storyScreen = new StoryScreen(this);
this.escapeScreen = new EscapeScreen(this);
this.bossScreen = new BossScreen(this);
this.helpScreen = new HelpScreen(this);
this.creditsScreen = new CreditsScreen(this);
this.minigamesScreen = new MinigameScreen(this);
this.bg3 = new Background(0,0,BACKGROUND_SPRITE3);
this.bg3.scrollFactor.x = this.bg3.scrollFactor.y = 0.4;
this.add(this.bg3);
this.add(this.emitters);
this.bg2 = new Background(0,0,BACKGROUND_SPRITE2);
this.bg2.scrollFactor.x = this.bg2.scrollFactor.y = 0.6;
this.add(this.bg2);
this.bg1 = new Background(0,0,BACKGROUND_SPRITE1);
this.bg1.scrollFactor.x = this.bg1.scrollFactor.y = 0.8;
this.add(this.bg1);
this.titleGlow = new ArcSprite(4,4,titleGlowSprite);
this.titleGlow.scrollFactor.x = this.titleGlow.scrollFactor.y = 0;
this.add(this.titleGlow);
this.title = new ArcSprite(4,4,titleSprite);
this.title.scrollFactor.x = this.title.scrollFactor.y = 0;
this.add(this.title);
ParticleSystem.initialize();
this.emitters.add(ArcParticleSystem.emitters);
switch(this._startScreen)
{
case 0:
this.switchScreen(this.mainScreen);
break;
case 1:
this.switchScreen(this.escapeScreen);
break;
case 2:
this.switchScreen(this.bossScreen);
break;
case 3:
this.switchScreen(this.storyScreen);
break;
case 4:
this.switchScreen(this.mainScreen);
}
this.options = new OptionsMenu(function():void
{
inOptions = false;
});
this.fader = new ArcSprite(0,0);
this.fader.makeGraphic(FlxG.width,FlxG.height,4278190080);
this.fader.scrollFactor.x = this.fader.scrollFactor.y = 0;
this.fader.visible = false;
this.add(this.fader);
this.faderStatus = 1;
Mouse.hide();
FlxG.mouse.show();
super.create();
SoundSystem.music(Sound.TITLE_MUSIC,0.5);
Data.kong();
Newgrounds.medals();
}
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.faderStatus == 1)
{
this.fader.alpha -= FlxG.elapsed * 3;
if(this.fader.alpha <= 0)
{
this.faderStatus = -1;
}
return;
}
if(ArcU.rand(0,15) == 5)
{
ArcParticleSystem.emit(this.emitters,"diamonds",ArcU.rand(0,360),0,1,1,5,0,0,0,100,300);
}
if(this.titleFadeIn)
{
this.titleGlow.alpha += FlxG.elapsed;
if(this.titleGlow.alpha >= 1)
{
this.titleGlow.alpha = 1;
this.titleFadeIn = false;
}
}
else
{
this.titleGlow.alpha -= FlxG.elapsed;
if(this.titleGlow.alpha <= 0)
{
this.titleGlow.alpha = 0;
this.titleFadeIn = true;
}
}
Data.time += FlxG.elapsed;
this.parallax();
SoundSystem.update();
super.update();
if(this.inOptions)
{
if(FlxG.keys.justPressed("ESCAPE"))
{
FlxG.keys.unJustPressed("ESCAPE");
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(this.tooltip == null || this.tooltip.source != _loc4_)
{
this.tooltip = new MenuTooltip(_loc4_.x + _loc4_.width / 2,_loc4_.y,_loc5_[0],_loc5_[1]);
this.tooltip.source = _loc4_;
}
this.hovering = true;
}
_loc3_++;
}
if(!this.hovering && this.tooltip != null)
{
this.tooltip = null;
}
this.hovering = false;
return;
}
if(this.screen == this.helpScreen)
{
this.title.alpha = 0;
this.titleGlow.alpha = 0;
}
else
{
this.title.alpha = 1;
}
this.screen.update();
if(!this.hovering && this.tooltip != null)
{
this.tooltip = null;
}
this.hovering = false;
}
override public function draw() : void
{
super.draw();
this.screen.draw();
if(this.inOptions)
{
this.options.draw();
if(this.tooltip != null)
{
this.tooltip.draw();
}
return;
}
if(this.faderStatus == 1)
{
this.fader.draw();
}
if(this.tooltip != null)
{
this.tooltip.draw();
}
}
protected function parallax() : void
{
var _loc1_:ArcSprite = null;
var _loc2_:int = 0;
for each(_loc1_ in [this.bg1,this.bg2,this.bg3])
{
_loc1_.y += FlxG.elapsed * 20 * _loc1_.scrollFactor.y;
_loc2_ = _loc1_.getScreenXY().y;
if(_loc2_ < -420)
{
_loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0);
}
else if(_loc2_ > 0)
{
_loc1_.y = FlxG.camera.scroll.y * _loc1_.scrollFactor.y - 420 + (_loc2_ > 0 && _loc2_ < 1000 ? _loc2_ : 0);
}
}
}
public function switchScreen(param1:MenuScreen) : void
{
if(this.screen == this.mainScreen)
{
(this.mainScreen as MainScreen).unbindPegas();
}
else if(param1 == this.mainScreen)
{
(this.mainScreen as MainScreen).bindPegas();
}
if(this.screen == this.creditsScreen)
{
(this.creditsScreen as CreditsScreen).unbindPegas();
}
else if(param1 == this.creditsScreen)
{
(this.creditsScreen as CreditsScreen).bindPegas();
}
this.screen = param1;
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/189.png")]
public class MainMenu_BACKGROUND_SPRITE1 extends BitmapAsset
{
public function MainMenu_BACKGROUND_SPRITE1()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/199.png")]
public class MainMenu_BACKGROUND_SPRITE2 extends BitmapAsset
{
public function MainMenu_BACKGROUND_SPRITE2()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/196.png")]
public class MainMenu_BACKGROUND_SPRITE3 extends BitmapAsset
{
public function MainMenu_BACKGROUND_SPRITE3()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/202.png")]
public class MainMenu_buttonHelp extends BitmapAsset
{
public function MainMenu_buttonHelp()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/187_com.arc.dh.state.MainMenu_buttonPlay.png")]
public class MainMenu_buttonPlay extends BitmapAsset
{
public function MainMenu_buttonPlay()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/81_com.arc.dh.state.MainMenu_soundButton.png")]
public class MainMenu_soundButton extends BitmapAsset
{
public function MainMenu_soundButton()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/138_com.arc.dh.state.MainMenu_titleGlowSprite.png")]
public class MainMenu_titleGlowSprite extends BitmapAsset
{
public function MainMenu_titleGlowSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/101_com.arc.dh.state.MainMenu_titleSprite.png")]
public class MainMenu_titleSprite extends BitmapAsset
{
public function MainMenu_titleSprite()
{
super();
}
}
}
@@ -0,0 +1,292 @@
package com.arc.dh.state
{
import com.arc.dh.menu.MenuTooltip;
import com.arc.dh.util.Config;
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.ArcSprite;
import flash.events.MouseEvent;
import org.flixel.FlxBitmapText;
import org.flixel.FlxG;
import org.flixel.FlxU;
public class MainScreen extends MenuScreen
{
private static const buttonStorySprite:Class = MainScreen_buttonStorySprite;
private static const buttonBossSprite:Class = MainScreen_buttonBossSprite;
private static const buttonEscapeSprite:Class = MainScreen_buttonEscapeSprite;
private static const buttonHelpSprite:Class = MainScreen_buttonHelpSprite;
private static const buttonCreditsSprite:Class = MainScreen_buttonCreditsSprite;
private static const buttonMinigameSprite:Class = MainScreen_buttonMinigameSprite;
private static const buttonUnlockSprite:Class = MainScreen_buttonUnlockSprite;
private static const buttonMoreGames:Class = MainScreen_buttonMoreGames;
public static const buttonPegas:Class = MainScreen_buttonPegas;
public static const buttonHost:Class = MainScreen_buttonHost;
public static const buttonAG:Class = MainScreen_buttonAG;
public static const buttonLikeAG:Class = MainScreen_buttonLikeAG;
public static const buttonMG:Class = MainScreen_buttonMG;
private static const buttonBossLockedSprite:Class = MainScreen_buttonBossLockedSprite;
private static const buttonEscapeLockedSprite:Class = MainScreen_buttonEscapeLockedSprite;
private static const buttonOptionsSprite:Class = MainScreen_buttonOptionsSprite;
private var _buttonStory:ArcButton;
private var _buttonBoss:ArcButton;
private var _buttonEscape:ArcButton;
private var _buttonHelp:ArcButton;
private var _buttonCredits:ArcButton;
private var _buttonMinigames:ArcButton;
private var _buttonUnlock:ArcButton;
private var _buttonPegas:ArcButton;
private var _buttonMoreGames:ArcButton;
private var _buttonHost:ArcButton;
private var _minigamesBox:ArcSprite;
private var _minigamesText:FlxBitmapText;
private var _optionsButton:ArcButton;
private var _bottomBar:ArcSprite;
private var _createdText:FlxBitmapText;
private var _versionText:FlxBitmapText;
private var bossUnlocked:Boolean;
private var escapeUnlocked:Boolean;
public function MainScreen(param1:MainMenu)
{
var agOffset:int = 0;
var M:MainMenu = param1;
super(M);
this._buttonStory = new ArcButton(43,103,87,26,buttonStorySprite).callback(function():void
{
menu.switchScreen(menu.storyScreen);
}).selectable(false);
this.add(this._buttonStory);
this.escapeUnlocked = Data.chapters[1][0] > 0;
this._buttonEscape = new ArcButton(134,103,87,26,this.escapeUnlocked ? buttonEscapeSprite : buttonEscapeLockedSprite).callback(function():void
{
if(escapeUnlocked)
{
menu.switchScreen(menu.escapeScreen);
}
}).selectable(false);
this.add(this._buttonEscape);
this.bossUnlocked = Data.chapters[6][0] > 0;
this._buttonBoss = new ArcButton(43,136,87,26,this.bossUnlocked ? buttonBossSprite : buttonBossLockedSprite).callback(function():void
{
if(bossUnlocked)
{
menu.switchScreen(menu.bossScreen);
}
}).selectable(false);
this.add(this._buttonBoss);
this._buttonMinigames = new ArcButton(134,136,87,26,buttonMinigameSprite).callback(function():void
{
menu.switchScreen(menu.minigamesScreen);
}).selectable(false);
this.add(this._buttonMinigames);
this._buttonHelp = new ArcButton(43,169,87,26,buttonHelpSprite).callback(function():void
{
menu.switchScreen(menu.helpScreen);
}).selectable(false);
this.add(this._buttonHelp);
this._buttonCredits = new ArcButton(134,169,87,26,buttonCreditsSprite).callback(function():void
{
menu.switchScreen(menu.creditsScreen);
}).selectable(false);
this.add(this._buttonCredits);
if(Config.RELEASE == Config.PEGAS)
{
this._buttonPegas = new ArcButton(230,100,106,46,buttonPegas).callback(function():void
{
}).selectable(false);
this.add(this._buttonPegas);
this._buttonMoreGames = new ArcButton(240,145,87,26,buttonMoreGames).callback(function():void
{
}).selectable(false);
this.add(this._buttonMoreGames);
this._buttonHost = new ArcButton(240,170,87,26,buttonHost).callback(function():void
{
}).selectable(false);
this.add(this._buttonHost);
}
else if(Config.RELEASE == Config.ARMORGAMES)
{
this._buttonPegas = new ArcButton(215,100,133,39,buttonAG).callback(function():void
{
FlxU.openURL("http://armorgames.com");
}).selectable(false);
this.add(this._buttonPegas);
this._buttonMoreGames = new ArcButton(240,144,87,26,buttonMoreGames).callback(function():void
{
FlxU.openURL("http://armorgames.com");
}).selectable(false);
this.add(this._buttonMoreGames);
this._buttonHost = new ArcButton(240,169,87,26,buttonLikeAG).callback(function():void
{
FlxU.openURL("http://facebook.com/armorgames");
}).selectable(false);
this.add(this._buttonHost);
agOffset = 20;
this._buttonStory.x -= agOffset;
this._buttonEscape.x -= agOffset;
this._buttonBoss.x -= agOffset;
this._buttonMinigames.x -= agOffset;
this._buttonHelp.x -= agOffset;
this._buttonCredits.x -= agOffset;
}
else if(Config.RELEASE == Config.MAXGAMES)
{
this._buttonPegas = new ArcButton(222,130,139,37,buttonMG).callback(function():void
{
FlxU.openURL("http://maxgames.com");
}).selectable(false);
this.add(this._buttonPegas);
}
this._bottomBar = new ArcSprite(0,228);
this._bottomBar.makeGraphic(Config.WIDTH,9,2566914048);
this.add(this._bottomBar);
this._createdText = new FlxBitmapText(4,230,Fonts.font(Fonts.SMALL_WHITE),"CREATED BY ARKEUS","left",200);
this._createdText.alpha = 0.6;
this.add(this._createdText);
this._versionText = new FlxBitmapText(Config.WIDTH - 200 - 4,230,Fonts.font(Fonts.SMALL_WHITE),"VERSION " + Config.VERSION + " - " + Config.RELEASE.toUpperCase(),"right",200);
this._versionText.alpha = 0.6;
this.add(this._versionText);
this._optionsButton = new ArcButton(160,213,34,29,buttonOptionsSprite).callback(function():void
{
M.inOptions = true;
}).selectable(false);
this.add(this._optionsButton);
if(Config.RELEASE == Config.FLASHGAMELICENSE || Config.DEBUG)
{
this._buttonUnlock = new ArcButton(134,212,87,26,buttonUnlockSprite).callback(function():void
{
Data.diamonds = 105000;
Data.chapters = [[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000],[1,1000000]];
Data.redDiamonds = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
Data.moonboots = 1;
Data.skyboots = 1;
Data.autofirer = 1;
Data.xrayscope = 1;
Data.lasersight = 1;
Data.moltensuit = 1;
Data.spreader = 1;
Data.rebound = 1;
Data.missile = 1;
Data.prime = 1;
Data.escape = [1,1,1,1,1,1];
Data.heartcrystals = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
Data.vitality = 17;
Data.achievements = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
Data.boss = [1,1000000,1,1000000];
DataSerializer.save();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new MainMenu());
});
}).selectable(false);
this.add(this._buttonUnlock);
}
}
public function bindPegas() : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegas);
}
public function unbindPegas() : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegas);
}
private function pegas(param1:*) : void
{
if(Config.RELEASE != Config.PEGAS)
{
return;
}
if(menu.inOptions)
{
return;
}
if(this._buttonPegas.hover() || this._buttonMoreGames.hover())
{
FlxU.openURL("http://www.pegasgames.com/");
}
if(this._buttonHost.hover())
{
FlxU.openURL("http://games.mochiads.com/c/g/diamond-hollow-ii/DiamondHollowII.swf");
}
}
override public function update() : void
{
if(this._buttonBoss.hover() && !this.bossUnlocked)
{
if(menu.tooltip == null || menu.tooltip.source != this._buttonBoss)
{
menu.tooltip = new MenuTooltip(this._buttonBoss.x + this._buttonBoss.width / 2,this._buttonBoss.y,"Boss Rush Locked","You must complete chapter 7 of story mode to unlock Boss Rush");
menu.tooltip.source = this._buttonBoss;
}
menu.hovering = true;
}
else if(this._buttonEscape.hover() && !this.escapeUnlocked)
{
if(menu.tooltip == null || menu.tooltip.source != this._buttonEscape)
{
menu.tooltip = new MenuTooltip(this._buttonEscape.x + this._buttonEscape.width / 2,this._buttonEscape.y,"Escape Mode Locked","You must complete chapter 2 of story mode to unlock Escape Mode");
menu.tooltip.source = this._buttonEscape;
}
menu.hovering = true;
}
if(FlxG.keys.justPressed("L"))
{
FlxG.log("FlxG.stage.root.loaderInfo.loaderURL: " + FlxG.stage.root.loaderInfo.loaderURL);
FlxG.log("FlxG.stage.loaderInfo.loaderURL: " + FlxG.stage.loaderInfo.loaderURL);
FlxG.log("FlxG.root.loaderInfo.loaderURL: " + FlxG.root.loaderInfo.loaderURL);
}
super.update();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/246_com.arc.dh.state.MainScreen_buttonAG.png")]
public class MainScreen_buttonAG extends BitmapAsset
{
public function MainScreen_buttonAG()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/178_com.arc.dh.state.MainScreen_buttonBossLockedSprite.png")]
public class MainScreen_buttonBossLockedSprite extends BitmapAsset
{
public function MainScreen_buttonBossLockedSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/58_com.arc.dh.state.MainScreen_buttonBossSprite.png")]
public class MainScreen_buttonBossSprite extends BitmapAsset
{
public function MainScreen_buttonBossSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/214_com.arc.dh.state.MainScreen_buttonCreditsSprite.png")]
public class MainScreen_buttonCreditsSprite extends BitmapAsset
{
public function MainScreen_buttonCreditsSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/293_com.arc.dh.state.MainScreen_buttonEscapeLockedSprite.png")]
public class MainScreen_buttonEscapeLockedSprite extends BitmapAsset
{
public function MainScreen_buttonEscapeLockedSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/255_com.arc.dh.state.MainScreen_buttonEscapeSprite.png")]
public class MainScreen_buttonEscapeSprite extends BitmapAsset
{
public function MainScreen_buttonEscapeSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/202.png")]
public class MainScreen_buttonHelpSprite extends BitmapAsset
{
public function MainScreen_buttonHelpSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/294_com.arc.dh.state.MainScreen_buttonHost.png")]
public class MainScreen_buttonHost extends BitmapAsset
{
public function MainScreen_buttonHost()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/180_com.arc.dh.state.MainScreen_buttonLikeAG.png")]
public class MainScreen_buttonLikeAG extends BitmapAsset
{
public function MainScreen_buttonLikeAG()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/168_com.arc.dh.state.MainScreen_buttonMG.png")]
public class MainScreen_buttonMG extends BitmapAsset
{
public function MainScreen_buttonMG()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/258_com.arc.dh.state.MainScreen_buttonMinigameSprite.png")]
public class MainScreen_buttonMinigameSprite extends BitmapAsset
{
public function MainScreen_buttonMinigameSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/122_com.arc.dh.state.MainScreen_buttonMoreGames.png")]
public class MainScreen_buttonMoreGames extends BitmapAsset
{
public function MainScreen_buttonMoreGames()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/84.png")]
public class MainScreen_buttonOptionsSprite extends BitmapAsset
{
public function MainScreen_buttonOptionsSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/160_com.arc.dh.state.MainScreen_buttonPegas.png")]
public class MainScreen_buttonPegas extends BitmapAsset
{
public function MainScreen_buttonPegas()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/170_com.arc.dh.state.MainScreen_buttonStorySprite.png")]
public class MainScreen_buttonStorySprite extends BitmapAsset
{
public function MainScreen_buttonStorySprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/119_com.arc.dh.state.MainScreen_buttonUnlockSprite.png")]
public class MainScreen_buttonUnlockSprite extends BitmapAsset
{
public function MainScreen_buttonUnlockSprite()
{
super();
}
}
}
@@ -0,0 +1,59 @@
package com.arc.dh.state
{
import flash.display.Loader;
import flash.events.Event;
import flash.media.SoundMixer;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import org.flixel.FlxG;
import org.flixel.FlxState;
public class MaxGames extends FlxState
{
private static var AG:Class = MaxGames_AG;
private var len:Number = 180;
private var zoomFactor:int = 1;
private var movie:Loader;
public function MaxGames()
{
super();
}
override public function create() : void
{
this.movie = new Loader();
var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
this.movie.loadBytes(new AG(),_loc1_);
this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve);
}
private function contentsRetrieve(param1:Event) : void
{
this.movie.scaleX = 1 / this.zoomFactor;
this.movie.scaleY = 1 / this.zoomFactor;
this.movie.x = 90;
this.movie.y = 40;
FlxG.stage.addChildAt(this.movie,0);
this.movie.addEventListener(Event.EXIT_FRAME,this.next);
}
private function next(param1:Event) : void
{
--this.len;
if(this.len <= 0)
{
this.movie.removeEventListener(Event.EXIT_FRAME,this.next);
this.movie.unloadAndStop(true);
FlxG.stage.removeChildAt(0);
SoundMixer.stopAll();
FlxG.switchState(new MainMenu());
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.ByteArrayAsset;
[Embed(source="/_assets/163_com.arc.dh.state.MaxGames_AG.bin", mimeType="application/octet-stream")]
public class MaxGames_AG extends ByteArrayAsset
{
public function MaxGames_AG()
{
super();
}
}
}
@@ -0,0 +1,17 @@
package com.arc.dh.state
{
import com.arc.flixel.ArcGroup;
public class MenuScreen extends ArcGroup
{
public var menu:MainMenu;
public function MenuScreen(param1:MainMenu)
{
super();
this.menu = param1;
}
}
}
@@ -0,0 +1,148 @@
package com.arc.dh.state
{
import com.arc.dh.entities.PlayerTadpole;
import com.arc.dh.menu.MenuTooltip;
import com.arc.dh.menu.StatisticsChapter;
import com.arc.dh.util.Data;
import com.arc.dh.util.Fonts;
import com.arc.dh.util.SoundSystem;
import com.arc.flixel.ArcButton;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxBitmapText;
import org.flixel.FlxG;
public class MinigameScreen extends MenuScreen
{
private static const buttonBackSprite:Class = MinigameScreen_buttonBackSprite;
private static const buttonPlaySprite:Class = MinigameScreen_buttonPlaySprite;
private static const buttonLockedSprite:Class = MinigameScreen_buttonLockedSprite;
private static const buttonRunUnlockedSprite:Class = MinigameScreen_buttonRunUnlockedSprite;
private var _buttonBack:ArcButton;
private var _buttonRun:ArcButton;
private var _buttonTadpole:ArcButton;
private var runUnlocked:Boolean;
private var tadpoleUnlocked:Boolean;
public function MinigameScreen(param1:MainMenu)
{
var run:ArcSprite;
var tadpole:ArcSprite;
var heroicUnlocked:Boolean;
var red:ArcSprite;
var M:MainMenu = param1;
super(M);
this.add(new InstructionWindow(0,100,FlxG.width,33));
this.add(new FlxBitmapText(10,104,Fonts.font(Fonts.OUTLINE_GRADIENT),"As you explore the various environments of story mode, you will find red diamonds hidden in the darkest corners of the cave. In addition to providing you with 100 diamonds, these will unlock the minigames below.".toUpperCase(),"center",FlxG.width - 20));
this.runUnlocked = Data.redDiamondCount >= 15;
this.tadpoleUnlocked = Data.redDiamondCount >= 25;
this.add(new InstructionWindow(0,140,FlxG.width,30));
this.add(new InstructionWindow(0,177,FlxG.width,30));
run = new ArcSprite(10,145);
run.loadGraphic(buttonRunUnlockedSprite,true,false,13,18);
run.frame = 0;
this.add(run);
this.add(new FlxBitmapText(30,142,Fonts.font(Fonts.OUTLINE_GRADIENT),"Runner Mode".toUpperCase(),"center",237));
this.add(new FlxBitmapText(30,150,Fonts.font(Fonts.OUTLINE_BLACK),"Protect yourself as you run at increasing speeds in an attempt to escape once and for all.".toUpperCase(),"center",237));
this.add(new FlxBitmapText(30,179,Fonts.font(Fonts.OUTLINE_GRADIENT),"Tadpole Mode".toUpperCase(),"center",237));
this.add(new FlxBitmapText(30,187,Fonts.font(Fonts.OUTLINE_BLACK),"Control a lone blue tadpole as he swims his way through his venomous brethren.".toUpperCase(),"center",237));
tadpole = new ArcSprite(10,183);
tadpole.loadGraphic(PlayerTadpole.sprite,true,false,16,16);
tadpole.frame = 0;
this.add(tadpole);
this._buttonRun = new ArcButton(270,142,87,26,this.runUnlocked ? buttonPlaySprite : buttonLockedSprite).callback(function():void
{
if(runUnlocked)
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new RunMode());
});
}
}).selectable(false);
this.add(this._buttonRun);
heroicUnlocked = Data.boss[0] > 0;
this._buttonTadpole = new ArcButton(270,179,87,26,this.tadpoleUnlocked ? buttonPlaySprite : buttonLockedSprite).callback(function():void
{
if(tadpoleUnlocked)
{
SoundSystem.fadeOutMusic();
FlxG.fade(4278190080,0.25,function():void
{
FlxG.mouse.hide();
FlxG.switchState(new TadpoleMode());
});
}
}).selectable(false);
this.add(this._buttonTadpole);
this._buttonBack = new ArcButton(135,213,87,26,buttonBackSprite).callback(function():void
{
menu.switchScreen(menu.mainScreen);
}).selectable(false);
this.add(this._buttonBack);
red = new ArcSprite(5,FlxG.height - 15);
red.loadGraphic(StatisticsChapter.redDiamondObtained,true,false,10,10);
red.addAnimation("glow",[0,1,2,3,4,5,4,3,2,1],5,true);
red.play("glow");
this.add(red);
this.add(new FlxBitmapText(17,FlxG.height - 15 + 2,Fonts.font(Fonts.OUTLINE_BLACK_S),Data.redDiamondCount.toString(),"left",237));
}
override public function update() : void
{
super.update();
if(this._buttonRun.hover())
{
if(menu.tooltip == null || menu.tooltip.source != this._buttonRun)
{
if(this.runUnlocked)
{
menu.tooltip = new MenuTooltip(this._buttonRun.x + this._buttonRun.width / 2,this._buttonRun.y,"Runner Mode","Max Distance: " + Data.maxRunDistance + "M\n\nJump and shoot while avoiding enemies. Be sure not to fall!");
}
else
{
menu.tooltip = new MenuTooltip(this._buttonRun.x + this._buttonRun.width / 2,this._buttonRun.y,"Runner Mode","Requires 15 red diamonds to unlock");
}
menu.tooltip.source = this._buttonRun;
}
menu.hovering = true;
}
else if(this._buttonTadpole.hover())
{
if(menu.tooltip == null || menu.tooltip.source != this._buttonTadpole)
{
if(this.tadpoleUnlocked)
{
menu.tooltip = new MenuTooltip(this._buttonTadpole.x + this._buttonTadpole.width / 2,this._buttonTadpole.y - 1,"Tadpole Mode","Max Distance: " + Data.maxTadpoleDistance + "M\n\nClick or press space to swim up, release to swim down.");
}
else
{
menu.tooltip = new MenuTooltip(this._buttonTadpole.x + this._buttonTadpole.width / 2,this._buttonTadpole.y - 1,"Tadpole Mode","Requires 25 red diamonds to unlock");
}
menu.tooltip.source = this._buttonTadpole;
}
menu.hovering = true;
}
if(FlxG.keys.justPressed("ESCAPE"))
{
menu.switchScreen(menu.mainScreen);
}
}
override public function draw() : void
{
super.draw();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/56.png")]
public class MinigameScreen_buttonBackSprite extends BitmapAsset
{
public function MinigameScreen_buttonBackSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/287_com.arc.dh.state.MinigameScreen_buttonLockedSprite.png")]
public class MinigameScreen_buttonLockedSprite extends BitmapAsset
{
public function MinigameScreen_buttonLockedSprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/99_com.arc.dh.state.MinigameScreen_buttonPlaySprite.png")]
public class MinigameScreen_buttonPlaySprite extends BitmapAsset
{
public function MinigameScreen_buttonPlaySprite()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/268_com.arc.dh.state.MinigameScreen_buttonRunUnlockedSprite.png")]
public class MinigameScreen_buttonRunUnlockedSprite extends BitmapAsset
{
public function MinigameScreen_buttonRunUnlockedSprite()
{
super();
}
}
}
@@ -0,0 +1,129 @@
package com.arc.dh.state
{
import com.arc.dh.util.Data;
import com.newgrounds.API;
import com.newgrounds.Medal;
import org.flixel.FlxG;
public class Newgrounds
{
public function Newgrounds()
{
super();
}
public static function connect() : void
{
API.connect(FlxG.root,"20663:ioaF01MQ","VvUV6AX4nPAMsy99C3Kss7NEhphnph9u","DH2-1");
}
private static function medal(param1:String) : void
{
var _loc2_:Medal = API.getMedal(param1);
if(!_loc2_.unlocked)
{
_loc2_.unlock();
}
}
public static function medals() : void
{
if(Data.totaldiamonds >= 100)
{
medal("100 Diamonds");
}
if(Data.totaldiamonds >= 5000)
{
medal("5000 Diamonds");
}
if(Data.totaldiamonds >= 25000)
{
medal("25000 Diamonds");
}
if(Data.chapters[0][0] > 0)
{
medal("Chapter 1");
}
if(Data.chapters[6][0] > 0)
{
medal("Chapter 7");
}
if(Data.maxheight >= 500)
{
medal("Escape 500");
}
if(Data.maxheight >= 1000)
{
medal("Escape 1000");
}
if(Data.maxheight >= 1500)
{
medal("Escape 1500");
}
if(Data.maxheight >= 2000)
{
medal("Escape 2000");
}
var _loc1_:int = 0;
var _loc2_:int = 0;
while(_loc2_ < Data.heartcrystals.length)
{
_loc1_ += Data.heartcrystals[_loc2_];
_loc2_++;
}
if(_loc1_ >= 5)
{
medal("5 Hearts");
}
if(_loc1_ >= 17)
{
medal("17 Hearts");
}
_loc1_ = 0;
_loc2_ = 0;
while(_loc2_ < Data.redDiamonds.length)
{
_loc1_ += Data.redDiamonds[_loc2_];
_loc2_++;
}
if(_loc1_ >= 5)
{
medal("5 Red Diamonds");
}
if(_loc1_ >= 15)
{
medal("15 Red Diamonds");
}
if(_loc1_ >= 35)
{
medal("35 Red Diamonds");
}
if(Data.enemies >= 300)
{
medal("300 Enemies");
}
if(Data.enemies >= 1000)
{
medal("1000 Enemies");
}
if(Data.maxTadpoleDistance >= 1000)
{
medal("Just Keep Swimming");
}
if(Data.maxRunDistance >= 2000)
{
medal("Tired Yet?");
}
if(Data.boss[0] > 0)
{
medal("Normalbrine");
}
if(Data.boss[2] > 0)
{
medal("Herobrine");
}
}
}
}
@@ -0,0 +1,83 @@
package com.arc.dh.state
{
import com.arc.dh.util.Config;
import flash.display.Loader;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.SoundMixer;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import org.flixel.FlxG;
import org.flixel.FlxState;
import org.flixel.FlxU;
public class Pegas extends FlxState
{
private static var AG:Class = Pegas_AG;
private var len:Number = Config.DEBUG ? 0 : 330;
private var zoomFactor:int = 1;
private var movie:Loader;
private var _clicked:Boolean = false;
public function Pegas()
{
super();
}
override public function create() : void
{
FlxG.bgColor = 4281545523;
this.movie = new Loader();
var _loc1_:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
this.movie.loadBytes(new AG(),_loc1_);
this.movie.contentLoaderInfo.addEventListener(Event.COMPLETE,this.contentsRetrieve);
FlxG.stage.addEventListener(MouseEvent.CLICK,this.pegasSplash);
}
private function pegasSplash(param1:*) : void
{
if(!this._clicked)
{
FlxU.openURL("http://www.pegasgames.com/");
this._clicked = true;
this.len = 10;
}
}
override public function update() : void
{
super.update();
}
private function contentsRetrieve(param1:Event) : void
{
this.movie.scaleX = 1 / this.zoomFactor;
this.movie.scaleY = 1 / this.zoomFactor;
this.movie.x = (FlxG.width * 2 - 550) / 2;
this.movie.y = (FlxG.height * 2 - 400) / 2;
this.movie.opaqueBackground = 3355443;
FlxG.stage.addChildAt(this.movie,0);
this.movie.addEventListener(Event.EXIT_FRAME,this.next);
}
private function next(param1:Event) : void
{
--this.len;
if(this.len <= 0)
{
FlxG.stage.removeChildAt(0);
SoundMixer.stopAll();
this.movie.removeEventListener(Event.EXIT_FRAME,this.next);
this.movie.unload();
FlxG.stage.removeEventListener(MouseEvent.CLICK,this.pegasSplash);
FlxG.switchState(new MainMenu());
}
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.ByteArrayAsset;
[Embed(source="/_assets/98_com.arc.dh.state.Pegas_AG.bin", mimeType="application/octet-stream")]
public class Pegas_AG extends ByteArrayAsset
{
public function Pegas_AG()
{
super();
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/189.png")]
public class PlayMode_BG1_1 extends BitmapAsset
{
public function PlayMode_BG1_1()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/189.png")]
public class PlayMode_BG1_2 extends BitmapAsset
{
public function PlayMode_BG1_2()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/191_com.arc.dh.state.PlayMode_BG1_3.png")]
public class PlayMode_BG1_3 extends BitmapAsset
{
public function PlayMode_BG1_3()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/192_com.arc.dh.state.PlayMode_BG1_4.png")]
public class PlayMode_BG1_4 extends BitmapAsset
{
public function PlayMode_BG1_4()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/183_com.arc.dh.state.PlayMode_BG1_5.png")]
public class PlayMode_BG1_5 extends BitmapAsset
{
public function PlayMode_BG1_5()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/184_com.arc.dh.state.PlayMode_BG1_6.png")]
public class PlayMode_BG1_6 extends BitmapAsset
{
public function PlayMode_BG1_6()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/185_com.arc.dh.state.PlayMode_BG1_7.png")]
public class PlayMode_BG1_7 extends BitmapAsset
{
public function PlayMode_BG1_7()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/199.png")]
public class PlayMode_BG2_1 extends BitmapAsset
{
public function PlayMode_BG2_1()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/199.png")]
public class PlayMode_BG2_2 extends BitmapAsset
{
public function PlayMode_BG2_2()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/204_com.arc.dh.state.PlayMode_BG2_3.png")]
public class PlayMode_BG2_3 extends BitmapAsset
{
public function PlayMode_BG2_3()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/195_com.arc.dh.state.PlayMode_BG2_4.png")]
public class PlayMode_BG2_4 extends BitmapAsset
{
public function PlayMode_BG2_4()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/193_com.arc.dh.state.PlayMode_BG2_5.png")]
public class PlayMode_BG2_5 extends BitmapAsset
{
public function PlayMode_BG2_5()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/198_com.arc.dh.state.PlayMode_BG2_6.png")]
public class PlayMode_BG2_6 extends BitmapAsset
{
public function PlayMode_BG2_6()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/197_com.arc.dh.state.PlayMode_BG2_7.png")]
public class PlayMode_BG2_7 extends BitmapAsset
{
public function PlayMode_BG2_7()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/196.png")]
public class PlayMode_BG3_1 extends BitmapAsset
{
public function PlayMode_BG3_1()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/196.png")]
public class PlayMode_BG3_2 extends BitmapAsset
{
public function PlayMode_BG3_2()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/203_com.arc.dh.state.PlayMode_BG3_3.png")]
public class PlayMode_BG3_3 extends BitmapAsset
{
public function PlayMode_BG3_3()
{
super();
}
}
}
@@ -0,0 +1,15 @@
package com.arc.dh.state
{
import mx.core.BitmapAsset;
[Embed(source="/_assets/200_com.arc.dh.state.PlayMode_BG3_4.png")]
public class PlayMode_BG3_4 extends BitmapAsset
{
public function PlayMode_BG3_4()
{
super();
}
}
}

Some files were not shown because too many files have changed in this diff Show More