initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.objects.powerups.Powerup;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.dh.util.Sound;
|
||||
import com.arc.dh.util.SoundSystem;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class Checkpoint extends Powerup
|
||||
{
|
||||
|
||||
private static const sprite:Class = Checkpoint_sprite;
|
||||
|
||||
private static const spriteRed:Class = Checkpoint_spriteRed;
|
||||
|
||||
private var _activated:Boolean = false;
|
||||
|
||||
public function Checkpoint(param1:Number, param2:Number)
|
||||
{
|
||||
var _loc6_:Array = null;
|
||||
super(param1,param2);
|
||||
Data.state.spawner[_c + "," + _r] = true;
|
||||
var _loc3_:Boolean = false;
|
||||
var _loc4_:Array = Data.state.checkpoints;
|
||||
var _loc5_:int = 0;
|
||||
while(_loc5_ < _loc4_.length)
|
||||
{
|
||||
_loc6_ = _loc4_[_loc5_];
|
||||
if(_loc6_[0] == param1 && _loc6_[1] == param2)
|
||||
{
|
||||
loadRotatedGraphic(spriteRed,32,-1,true,true);
|
||||
this._activated = true;
|
||||
_loc3_ = true;
|
||||
break;
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
if(!_loc3_)
|
||||
{
|
||||
loadRotatedGraphic(sprite,32,-1,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
override public function update() : void
|
||||
{
|
||||
angle += FlxG.elapsed * 300;
|
||||
super.update();
|
||||
}
|
||||
|
||||
override public function activate() : void
|
||||
{
|
||||
if(this._activated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
loadRotatedGraphic(spriteRed,32,-1,true,true);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.RED,x,y,25,1,2,0,-200,200,-200,200,width,height);
|
||||
ArcParticleSystem.emit(Data.state.emitters,Color.BLACK,x,y,25,1,2,0,-200,200,-200,200,width,height);
|
||||
this._activated = true;
|
||||
Data.state.checkpoints.push([_c,_r]);
|
||||
Data.state.checkpoint();
|
||||
Data.hp = Data.hpm;
|
||||
SoundSystem.play(Sound.CHECKPOINT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user