66 lines
1.2 KiB
Haxe
66 lines
1.2 KiB
Haxe
package entity.enemy.etc
|
|
{
|
|
import entity.interactive.npc.Space_NPC;
|
|
import flash.display.InterpolationMethod;
|
|
import flash.geom.Point;
|
|
import helper.EventScripts;
|
|
import org.flixel.AnoSprite;
|
|
import org.flixel.FlxG;
|
|
import org.flixel.FlxSprite;
|
|
|
|
class Space_Face extends AnoSprite
|
|
{
|
|
|
|
|
|
public var t_dash:Float=0;
|
|
public var tm_dash:Float;
|
|
|
|
public var t_calc_angle:Float=0;
|
|
public var tm_calc_angle:Float=0.2;
|
|
|
|
|
|
public function new(args:Array)
|
|
{
|
|
super(args);
|
|
|
|
loadGraphic(Space_NPC.embed_space_npc,true,false,16,16);
|
|
|
|
|
|
dame_frame=parseInt(xml.@frame);
|
|
|
|
// MARINA_ANIMS(face)
|
|
// Happy
|
|
if(dame_frame==0){
|
|
addAnimation("a", [22,23], 6, true);
|
|
// Sad
|
|
} else if(dame_frame==1){
|
|
addAnimation("a", [20,21], 6);
|
|
}
|
|
play("a");
|
|
|
|
tm_dash=0.5 + 1.5 * Math.random();
|
|
}
|
|
|
|
override public function update():Void
|
|
{
|
|
if(!did_init){
|
|
did_init=true;
|
|
parent.sortables.remove(this, true);
|
|
parent.bg_sprites.add(this);
|
|
}
|
|
|
|
if(EventScripts.time_cond(this,"t_dash","tm_dash")){
|
|
EventScripts.scale_vector(this, player, velocity, 55);// dash vel
|
|
drag.x=drag.y=15 + 10 * Math.random();
|
|
}
|
|
|
|
|
|
super.update();
|
|
}
|
|
|
|
override public function destroy():Void
|
|
{
|
|
super.destroy();
|
|
}
|
|
|
|
} |