-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLooserWorld.as
43 lines (38 loc) · 895 Bytes
/
LooserWorld.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
package {
import net.flashpunk.World;
import flash.geom.Point;
import net.flashpunk.graphics.Text;
import net.flashpunk.Entity;
import net.flashpunk.utils.Input;
import net.flashpunk.utils.Key;
import net.flashpunk.FP;
/**
* @author jamescarpenter
*/
public class LooserWorld extends World
{
private var waited:Boolean = false;
public function LooserWorld()
{
}
override public function begin():void
{
var statusentity:Entity = new Entity();
var statusstring:Text = new Text("Oh dear!\nDid I hit you with my handbag?\nAre you OK?\nDreadfully sorry dear!\nAgain?");
statusentity.graphic = statusstring;
add(statusentity);
FP.alarm(2, timeout);
}
override public function update():void
{
if(Input.check(Key.SPACE) && waited)
{
FP.world = new GameWorld();
}
}
public function timeout() : void
{
waited = true;
}
}
}