forked from noio/kingdom
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHaze.as
More file actions
executable file
·27 lines (23 loc) · 790 Bytes
/
Haze.as
File metadata and controls
executable file
·27 lines (23 loc) · 790 Bytes
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
package{
import org.flixel.FlxSprite;
import org.flixel.FlxG;
public class Haze extends FlxSprite{
private var weather:Weather;
private var weatherChanged:Number = -1;
public function Haze(X:int, Y:int, weather:Weather){
super(X,Y);
this.weather = weather;
makeGraphic(FlxG.width,FlxG.height,0x00000000);
scrollFactor.x = 0;
}
override public function draw():void{
if (weather.changed > weatherChanged){
fill(0);
Utils.gradientOverlay(pixels,[weather.haze&0xFFFFFF,weather.haze], 90,1);
weatherChanged = weather.t;
dirty = true;
}
super.draw();
}
}
}