-
Notifications
You must be signed in to change notification settings - Fork 0
/
FishPort.as
47 lines (41 loc) · 1 KB
/
FishPort.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
package com.asgamer
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class FishPort extends MainBuild
{
private var stageRef:Stage;
private var fishTimer:Timer;
public const what:String = "Food factory";
public function FishPort(stageRef:Stage)
{
this.stageRef = stageRef;
addEventListener(Event.ENTER_FRAME,loop,false,0,true);
addEventListener(MouseEvent.CLICK,dropFish,false,0,true);
}
override protected function loop(e:Event):void
{
dropper(stageRef);
blocker();
clicker(square,lifeBar,upBar);
lifeStatus(lifeBar,lifeBar.green,13,square);
upgradStart(upBar,upBar.blue,13);
repairStart();
if(startWorking == true)
Engine.score.updateFood(0.05+(level/40));
}
private function dropFish(e:MouseEvent)
{
mainDrop(-200,-50);
startWorking = true;
}
public function takeHit()
{
life -=0.5;
}
}
}