initial commit, kind of working.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.arc.dh.objects
|
||||
{
|
||||
import com.arc.dh.Color;
|
||||
import com.arc.dh.util.Data;
|
||||
import com.arc.flixel.ArcParticleSystem;
|
||||
import org.flixel.FlxG;
|
||||
|
||||
public class Missile extends Bullet
|
||||
{
|
||||
|
||||
public static const sprite:Class = Missile_sprite;
|
||||
|
||||
private var _particleTime:Number = 0;
|
||||
|
||||
public function Missile(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super(param1,param2,param3,param4);
|
||||
loadRotatedGraphic(sprite,60,-1,true,false);
|
||||
width = 3;
|
||||
height = 3;
|
||||
offset.x = 6;
|
||||
offset.y = 6;
|
||||
angle = param4 * 57.2957795;
|
||||
}
|
||||
|
||||
override public function draw() : void
|
||||
{
|
||||
this._particleTime -= FlxG.elapsed;
|
||||
if(this._particleTime <= 0)
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLACK,getMidpoint().x,getMidpoint().y,1,1,0,0,0,0,0,0);
|
||||
this._particleTime = 0.02;
|
||||
}
|
||||
super.draw();
|
||||
}
|
||||
|
||||
override public function kill() : void
|
||||
{
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.BLACK,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30);
|
||||
ArcParticleSystem.emit(Data.state.particles,Color.WHITE,x + width / 2,y + width / 2,5,2,0.2,0,-30,30,-30,30);
|
||||
alive = false;
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user