-
Notifications
You must be signed in to change notification settings - Fork 3
/
Destination.as
executable file
·52 lines (43 loc) · 1.59 KB
/
Destination.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
40
41
42
43
44
45
46
47
48
49
50
51
52
package
{
import org.flixel.FlxSprite;
import org.flixel.FlxG;
import States.BuildState;
/**
* ...
* @author Nicholas 'A' Feinberg
*/
public class Destination extends TileComponent{
[Embed(source = "/images/Components/shaft.png")] private static const png:Class;
protected static const FRAME_ARRAY:Array = new Array(1, 2, 3, 4, 5, 4, 3, 2, 1, 0);
public function Destination() {
super(12,
Manufactoria.GRID_DIM + Manufactoria.inv_offset - 1,//7,
grid,
LEFT,
png, "Destination");
loadGraphic(png, true, false, 15, 15);
var animationSpeed:Number = FRAME_ARRAY.length / Robot.FLASH_TIME;
addAnimation("Convey!", FRAME_ARRAY, animationSpeed, false);
}
/*override public function update():void {
super.update();
if (FlxG.state is BuildState && overlapsPoint(FlxG.mouse.x, FlxG.mouse.y)) { //also: if FlxG.level == 1?
//if (something): spawn a little robo above, alpha, set his direction manually
//when asked for directions: animate, kill the robot (by fading, as ever!)
//once finished animating: loop!
}
//if not moused: kill robot (if robot), reset position
} */
override public function die():Boolean { return false }
override public function direct(robo:Robot):void {
robo.die(true);
play("Convey!", true);
_curAnim.delay = Robot.FLASH_TIME / (FRAME_ARRAY.length );
}
override public function unclip():TileComponent { return null; }
public static function get grid():int {
return Manufactoria.GRID_DIM * (Manufactoria.GRID_DIM - .5);
}
}
}