-
Notifications
You must be signed in to change notification settings - Fork 58
/
Attention.as
39 lines (32 loc) · 949 Bytes
/
Attention.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package
{
import flash.geom.Point;
import org.flixel.FlxParticle;
import org.flixel.FlxG;
import org.flixel.FlxObject;
import org.flixel.FlxPoint;
import org.flixel.FlxSprite;
public class Attention extends FlxParticle{
[Embed(source='/assets/gfx/attention.png')] private var Img:Class;
public var citizen:Citizen;
public function Attention(){
super();
loadGraphic(Img);
maxVelocity.x = 0;
maxVelocity.y = 0;
height = 8;
width = 8;
alpha = 0.5;
}
public function appearAt(at:Citizen):void{
citizen = at;
y = at.y - 4;
revive();
lifespan = 1;
}
override public function update():void{
x = citizen.x + citizen.width/2 - 4;
super.update()
}
}
}