-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layerable.as
41 lines (31 loc) · 941 Bytes
/
Layerable.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
package
{
import flash.display.MovieClip;
public class Layerable extends MovieClip
{
public var front_layer: MovieClip = new Layer();
public var score_layer: MovieClip = new Layer();
public var characters_layer: MovieClip = new Layer();
public var projectiles_layer: MovieClip = new Layer();
public var hitmarkers_layer: MovieClip = new Layer();
public var glow_layer: MovieClip = new Layer();
public var stars_layer: MovieClip = new Layer();
public function Layerable()
{
}
public function displayLayers(): void
{
addChild(stars_layer);
addChild(glow_layer);
addChild(hitmarkers_layer);
addChild(projectiles_layer);
addChild(characters_layer);
addChild(score_layer);
addChild(front_layer);
}
public function getCenterCoordinates(object: MovieClip, stage_width: Number = 720): Number
{
return (stage_width - object.width) / 2;
}
}
}