-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobot.as
121 lines (93 loc) · 1.88 KB
/
Robot.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
public class Robot extends MovieClip {
public var r_name:String;
public var author:String;
protected var weapon_type:int;
protected var engine_type:int;
protected var run:Boolean;
protected var exist:Boolean;
public function Robot(n:String="",a:String="")
{
// constructor code
exist = true;
r_name = n;
author = a;
run = false;
weapon_type = -1;
engine_type = -1;
/*
weapon_type = w;
engine_type = e;
weapon.gotoAndStop(w+1);
engine.gotoAndStop(e+1);
*/
}
public function Set_Weapon_Engine(w:int, e:int):void
{
Set_Weapon(w);
Set_Engine(e);
}
public function Set_Weapon(w:int):void
{
if (weapon_type != w)
{
weapon_type = w;
weapon.Set_Type(w);
}
}
public function Set_Engine(e:int):void
{
if (engine_type != e)
{
engine_type = e;
engine.Set_Type(e);
}
}
public function Run_Animation():void
{
if (!run)
{
//trace("asdfasfdasf");
run = true;
engine.Run_Animation();
}
}
public function Stop_Animation():void
{
if (run)
{
run = false;
engine.Stop_Animation();
}
}
public function Explode_Animation():void
{
//event.target.removeEventListener("explode_animation", Explode_Animation);
exist = false;
new S_Explo9().play();
addChild(new Explode_Robot);
engine.Stop_Animation();
addEventListener(Event.ENTER_FRAME, Disappear);
}
public function IsExist():Boolean
{
return exist;
}
public function Disappear(event:Event):void
{
if (alpha <= 0)
{
removeEventListener(Event.ENTER_FRAME, Disappear);
dispatchEvent(new Event("remove"));
}
else
{
alpha -= 0.1;
}
}
}
}