Skip to content

Commit 989ef50

Browse files
committed
timer
1 parent e9bb12f commit 989ef50

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

source/goals/KeypressGoal.hx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package goals;
2+
3+
import flixel.text.FlxText.FlxTextAlign;
4+
import ui.font.BitmapText.PressStart;
5+
import flixel.util.FlxColor;
6+
import states.PlayState;
7+
import flixel.FlxG;
8+
9+
class KeypressGoal extends Goal {
10+
override public function new() {
11+
super();
12+
}
13+
14+
override function initialize(state:PlayState) {
15+
super.initialize(state);
16+
}
17+
18+
override public function update(delta:Float) {
19+
super.update(delta);
20+
if (FlxG.keys.justPressed.P) {
21+
onComplete();
22+
}
23+
}
24+
}

source/managers/GameManager.hx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package managers;
22

33
import goals.PersonalFishCountGoal;
44
import goals.TimedGoal;
5+
import goals.KeypressGoal;
56
import flixel.util.FlxTimer;
67
import schema.RoundState;
78
import net.NetworkManager;
@@ -90,9 +91,9 @@ class GameManager {
9091
case RoundState.STATUS_LOBBY:
9192
if (NetworkManager.IS_HOST) {
9293
init([
93-
new Round([new TimedGoal(5), new PersonalFishCountGoal(3)]),
94-
new Round([new TimedGoal(3), new PersonalFishCountGoal(3)]),
95-
new Round([new TimedGoal(5), new PersonalFishCountGoal(3)]),
94+
new Round([new TimedGoal(), new PersonalFishCountGoal(3), new KeypressGoal()]),
95+
new Round([new TimedGoal(), new PersonalFishCountGoal(3), new KeypressGoal()]),
96+
new Round([new TimedGoal(), new PersonalFishCountGoal(3), new KeypressGoal()]),
9697
]);
9798
// needs to force this back to 0
9899
nextRoundNumber = currentRoundNumber;

0 commit comments

Comments
 (0)