initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class HeartCrystal extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = HeartCrystal_sprite;
|
||||
|
||||
private static const spriteBorder:Class = HeartCrystal_spriteBorder;
|
||||
|
||||
private static const sprite_outline:Class = HeartCrystal_sprite_outline;
|
||||
|
||||
private var _id:int;
|
||||
|
||||
public function HeartCrystal(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
this._id = param3;
|
||||
super(param1,param2,Data.heartcrystals[this._id] == 1 ? sprite_outline : sprite,Data.heartcrystals[this._id] == 1 ? null : Color.RED,Data.heartcrystals[this._id] == 1 ? sprite_outline : spriteBorder,17);
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(Data.heartcrystals[this._id] == 1)
|
||||
{
|
||||
solid = false;
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
if(Data.hp <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
++Data.hp;
|
||||
Data.heartcrystals[this._id] = 1;
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < 17)
|
||||
{
|
||||
_loc1_ += Data.heartcrystals[_loc2_];
|
||||
_loc2_++;
|
||||
}
|
||||
Data.vitality = _loc1_;
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,2,0.5,0,-80,80,-80,80);
|
||||
AchievementSystem.heartcrystal();
|
||||
SoundSystem.play(Sound.HEART_CRYSTAL);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/96_com.arc.dh.objects.powerups.HeartCrystal_sprite.png")]
|
||||
public class HeartCrystal_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function HeartCrystal_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/112_com.arc.dh.objects.powerups.HeartCrystal_spriteBorder.png")]
|
||||
public class HeartCrystal_spriteBorder extends BitmapAsset
|
||||
{
|
||||
|
||||
public function HeartCrystal_spriteBorder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/97_com.arc.dh.objects.powerups.HeartCrystal_sprite_outline.png")]
|
||||
public class HeartCrystal_sprite_outline extends BitmapAsset
|
||||
{
|
||||
|
||||
public function HeartCrystal_sprite_outline()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.entities.Entity;
|
||||
import com.arc.dh.objects.Checkpoint;
|
||||
import com.arc.dh.util.Config;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class Powerup extends Entity
|
||||
{
|
||||
|
||||
public static const POWERUP_DIAMOND_BORDER:Class = Powerup_POWERUP_DIAMOND_BORDER;
|
||||
|
||||
protected var _border:ArcSprite;
|
||||
|
||||
private var _borderAlphaIncreasing:Boolean = true;
|
||||
|
||||
private var _sinOffset:Number = 0;
|
||||
|
||||
protected var _sy:int;
|
||||
|
||||
private var _yOffset:Number = 0;
|
||||
|
||||
private var _yOffsetIncreasing:Boolean = true;
|
||||
|
||||
protected var _particles:Object;
|
||||
|
||||
private var _particleTimer:Number = 0;
|
||||
|
||||
protected var _waver:Boolean = true;
|
||||
|
||||
protected var _c:int;
|
||||
|
||||
protected var _r:int;
|
||||
|
||||
public function Powerup(param1:Number, param2:Number, param3:Class = null, param4:Object = 7, param5:Class = null, param6:int = 13)
|
||||
{
|
||||
super(param1 * Config.BLOCK_SIZE,param2 * Config.BLOCK_SIZE - 5);
|
||||
this._c = param1;
|
||||
this._r = param2;
|
||||
if(param3 != null)
|
||||
{
|
||||
loadGraphic(param3,false,false,param6,param6);
|
||||
this._border = new ArcSprite(x,y,param5 == null ? POWERUP_DIAMOND_BORDER : param5);
|
||||
}
|
||||
this._sy = y;
|
||||
this._particles = param4;
|
||||
}
|
||||
|
||||
public function activate() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
if(outside)
|
||||
{
|
||||
if(this is Checkpoint || this is PowerupEquipment || this is PowerupFire || this is PowerupMagnet || this is PowerupShield)
|
||||
{
|
||||
Data.state.spawner[this._c + "," + this._r] = null;
|
||||
}
|
||||
kill();
|
||||
}
|
||||
if(this._border != null)
|
||||
{
|
||||
if(this._borderAlphaIncreasing)
|
||||
{
|
||||
this._border.alpha += FlxG.elapsed;
|
||||
if(this._border.alpha >= 1)
|
||||
{
|
||||
this._border.alpha = 1;
|
||||
this._borderAlphaIncreasing = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._border.alpha -= FlxG.elapsed;
|
||||
if(this._border.alpha <= 0.2)
|
||||
{
|
||||
this._border.alpha = 0.2;
|
||||
this._borderAlphaIncreasing = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this._waver)
|
||||
{
|
||||
if(this._yOffsetIncreasing)
|
||||
{
|
||||
this._yOffset += FlxG.elapsed * 4;
|
||||
if(this._yOffset >= 5)
|
||||
{
|
||||
this._yOffset = 5;
|
||||
this._yOffsetIncreasing = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._yOffset -= FlxG.elapsed * 4;
|
||||
if(this._yOffset <= 0)
|
||||
{
|
||||
this._yOffset = 0;
|
||||
this._yOffsetIncreasing = true;
|
||||
}
|
||||
}
|
||||
y = this._sy + this._yOffset;
|
||||
}
|
||||
if(this._particles != null)
|
||||
{
|
||||
this._particleTimer -= FlxG.elapsed;
|
||||
if(this._particleTimer <= 0)
|
||||
{
|
||||
this._particleTimer = 0.3;
|
||||
ArcParticleSystem.emit(Data.state.particles,this._particles,getMidpoint().x,getMidpoint().y,1,1,0.4,0,-20,20,-20,20);
|
||||
}
|
||||
}
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
super.draw();
|
||||
if(this._border != null)
|
||||
{
|
||||
this._border.x = x;
|
||||
this._border.y = y;
|
||||
this._border.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.dh.util.text.Avatar;
|
||||
import com.arc.dh.util.text.TextSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import com.arc.flixel.ArcSprite;
|
||||
|
||||
public class PowerupEquipment extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = PowerupEquipment_sprite;
|
||||
|
||||
private static const spriteBorder:Class = PowerupEquipment_spriteBorder;
|
||||
|
||||
private var _offset:int;
|
||||
|
||||
public function PowerupEquipment(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
super(param1,param2,null,Color.RED,null,14);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
loadGraphic(sprite,true,false,14,14);
|
||||
height = 20;
|
||||
addAnimation("equipment",[param3]);
|
||||
play("equipment");
|
||||
_border = new ArcSprite(x,y);
|
||||
_border.loadGraphic(spriteBorder,true,false,14,14);
|
||||
_border.addAnimation("equipment",[param3]);
|
||||
_border.play("equipment");
|
||||
this._offset = param3;
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
switch(this.name())
|
||||
{
|
||||
case "prime":
|
||||
Data.prime = 1;
|
||||
TextSystem.display(Avatar.SAGA,"Thank you for rescuing me. I am the Slime Annihilating Gun Appartus, call me SAGA. You can think of me as a very smart gun. I don\'t know how you ended up down here, but if we work together we can escape.");
|
||||
Data.state.ui.showGuns(true);
|
||||
break;
|
||||
case "spreader":
|
||||
Data.spreader = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That Spreader Chip will augment my ability to create bullets, allowing you to shoot multiple bullets at a time. Press 2 or use Q/E to switch to the Spreader Gun.");
|
||||
Data.state.ui.showGuns(true);
|
||||
break;
|
||||
case "missile":
|
||||
Data.missile = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That Missile Chip will allow me to shoot missiles strong enough to knock back slimes and destroy steel crates. Press 3 or use Q/E to switch to the Missile Gun.");
|
||||
Data.state.ui.showGuns(true);
|
||||
break;
|
||||
case "rebound":
|
||||
Data.rebound = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That Rebound Chip will allow me to enhance the elasticity of my bullets, causing them to bounce off walls. Press 4 or use Q/E to switch to the Rebound Gun.");
|
||||
Data.state.ui.showGuns(true);
|
||||
break;
|
||||
case "xrayscope":
|
||||
Data.xrayscope = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That X-Ray Scope Chip will allow me to send rays through the cave to find hidden areas. However, I cannot move or shoot bullets while generating a beam. Hold SHIFT to activate the X-Ray Scope.");
|
||||
break;
|
||||
case "autofirer":
|
||||
Data.autofirer = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That Autofire Chip you just collected activates my autofire ability. Press F to enable it.");
|
||||
break;
|
||||
case "lasersight":
|
||||
Data.lasersight = 1;
|
||||
TextSystem.display(Avatar.SAGA,"Laser Sight activated.");
|
||||
break;
|
||||
case "skyboots":
|
||||
Data.skyboots = 1;
|
||||
TextSystem.display(Avatar.SAGA,"Those are the prototype Sky Boots the professor developed. They will allow you to double jump.");
|
||||
break;
|
||||
case "moltensuit":
|
||||
Data.moltensuit = 1;
|
||||
TextSystem.display(Avatar.SAGA,"That Molten Suit will permit you to survive in lava for a short period of time.");
|
||||
break;
|
||||
case "moonboots":
|
||||
Data.moonboots = 1;
|
||||
TextSystem.display(Avatar.SAGA,"Those Moon Boots were very recently developed by The Professor. Use them to triple jump to help your escape.");
|
||||
}
|
||||
SoundSystem.play(Sound.EQUIPMENT);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.WHITE,getMidpoint().x,getMidpoint().y,20,1,1,0,-150,150,-150,150);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.CYAN,getMidpoint().x,getMidpoint().y,20,1,1,0,-100,100,-100,100);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLUE,getMidpoint().x,getMidpoint().y,20,1,1,0,-50,50,-50,50);
|
||||
kill();
|
||||
}
|
||||
|
||||
private function name() : String
|
||||
{
|
||||
switch(this._offset)
|
||||
{
|
||||
case 0:
|
||||
return "autofirer";
|
||||
case 1:
|
||||
return "lasersight";
|
||||
case 2:
|
||||
return "skyboots";
|
||||
case 3:
|
||||
return "moltensuit";
|
||||
case 4:
|
||||
return "moonboots";
|
||||
case 5:
|
||||
return "prime";
|
||||
case 6:
|
||||
return "spreader";
|
||||
case 7:
|
||||
return "missile";
|
||||
case 8:
|
||||
return "rebound";
|
||||
case 9:
|
||||
return "xrayscope";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/215.png")]
|
||||
public class PowerupEquipment_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupEquipment_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/221_com.arc.dh.objects.powerups.PowerupEquipment_spriteBorder.png")]
|
||||
public class PowerupEquipment_spriteBorder extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupEquipment_spriteBorder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.Gun;
|
||||
import com.arc.dh.objects.BulletFactory;
|
||||
import com.arc.dh.objects.BulletPrime;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
|
||||
public class PowerupFire extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = PowerupFire_sprite;
|
||||
|
||||
public function PowerupFire(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2,sprite);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc1_:int = getMidpoint().x;
|
||||
var _loc2_:int = getMidpoint().y;
|
||||
var _loc3_:int = 0;
|
||||
while(_loc3_ < 360)
|
||||
{
|
||||
_loc4_ = _loc3_ * Math.PI / 180;
|
||||
Data.state.bullets.add(BulletFactory.create(_loc1_,_loc2_,Gun.PRIME_SPEED,_loc4_,BulletPrime));
|
||||
_loc3_ += 6;
|
||||
}
|
||||
++Data.powerups;
|
||||
AchievementSystem.powerups();
|
||||
SoundSystem.play(Sound.POWERUP,2);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/155_com.arc.dh.objects.powerups.PowerupFire_sprite.png")]
|
||||
public class PowerupFire_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupFire_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class PowerupHeart extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = PowerupHeart_sprite;
|
||||
|
||||
private static const spriteBorder:Class = PowerupHeart_spriteBorder;
|
||||
|
||||
public function PowerupHeart(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2,sprite,Color.RED,spriteBorder);
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
++Data.hp;
|
||||
if(Data.hp > Data.hpm)
|
||||
{
|
||||
Data.hp = Data.hpm;
|
||||
}
|
||||
++Data.powerups;
|
||||
AchievementSystem.powerups();
|
||||
SoundSystem.play(Sound.HEART);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,1,0.5,0,-20,20,-20,20);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.WHITE,x + 6,y + 6,15,1,0.5,0,-20,20,-20,20);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/63_com.arc.dh.objects.powerups.PowerupHeart_sprite.png")]
|
||||
public class PowerupHeart_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupHeart_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/240_com.arc.dh.objects.powerups.PowerupHeart_spriteBorder.png")]
|
||||
public class PowerupHeart_spriteBorder extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupHeart_spriteBorder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.objects.Diamond;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
|
||||
public class PowerupMagnet extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = PowerupMagnet_sprite;
|
||||
|
||||
public function PowerupMagnet(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2,sprite);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
var _loc2_:Diamond = null;
|
||||
var _loc1_:Array = Data.state.diamonds.members;
|
||||
for each(_loc2_ in _loc1_)
|
||||
{
|
||||
_loc2_.magnet = true;
|
||||
}
|
||||
++Data.powerups;
|
||||
AchievementSystem.powerups();
|
||||
SoundSystem.play(Sound.POWERUP,2);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/217_com.arc.dh.objects.powerups.PowerupMagnet_sprite.png")]
|
||||
public class PowerupMagnet_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupMagnet_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
|
||||
public class PowerupShield extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = PowerupShield_sprite;
|
||||
|
||||
public function PowerupShield(param1:Number, param2:Number)
|
||||
{
|
||||
super(param1,param2,sprite);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
Data.state.player.shield(10);
|
||||
SoundSystem.play(Sound.POWERUP,2);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/231_com.arc.dh.objects.powerups.PowerupShield_sprite.png")]
|
||||
public class PowerupShield_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function PowerupShield_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/302_com.arc.dh.objects.powerups.Powerup_POWERUP_DIAMOND_BORDER.png")]
|
||||
public class Powerup_POWERUP_DIAMOND_BORDER extends BitmapAsset
|
||||
{
|
||||
|
||||
public function Powerup_POWERUP_DIAMOND_BORDER()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.state.StoryMode;
|
||||
import com.arc.dh.util.AchievementSystem;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
|
||||
public class RedDiamond extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = RedDiamond_sprite;
|
||||
|
||||
private static const sprite_outline:Class = RedDiamond_sprite_outline;
|
||||
|
||||
private var _id:int;
|
||||
|
||||
public function RedDiamond(param1:Number, param2:Number, param3:int)
|
||||
{
|
||||
super(param1,param2,null,Color.RED);
|
||||
x -= 6;
|
||||
y -= 6;
|
||||
_sy = y;
|
||||
this._id = param3;
|
||||
if(Data.hasRed((Data.state as StoryMode).chapter,this._id))
|
||||
{
|
||||
loadGraphic(sprite_outline,true,false,20,20);
|
||||
solid = false;
|
||||
alpha = 0.75;
|
||||
_particles = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
loadGraphic(sprite,true,false,20,20);
|
||||
}
|
||||
addAnimation("float",[0,1,2,3,4,5,4,3,2,1],10,true);
|
||||
play("float");
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
Data.obtainRed((Data.state as StoryMode).chapter,this._id);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.RED,x + 6,y + 6,15,2,0.5,0,-80,80,-80,80);
|
||||
Data.diamonds += 100;
|
||||
Data.totaldiamonds += 100;
|
||||
AchievementSystem.diamonds();
|
||||
Data.state.cdiamonds += 100;
|
||||
AchievementSystem.reddiamonds();
|
||||
AchievementSystem.diamonds();
|
||||
SoundSystem.play(Sound.RED_DIAMOND);
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/152_com.arc.dh.objects.powerups.RedDiamond_sprite.png")]
|
||||
public class RedDiamond_sprite extends BitmapAsset
|
||||
{
|
||||
|
||||
public function RedDiamond_sprite()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.arc.dh.objects.powerups
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[Embed(source="/_assets/292_com.arc.dh.objects.powerups.RedDiamond_sprite_outline.png")]
|
||||
public class RedDiamond_sprite_outline extends BitmapAsset
|
||||
{
|
||||
|
||||
public function RedDiamond_sprite_outline()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user