summaryrefslogtreecommitdiff
path: root/2026/games_submissions/cammymoop/js/stopwatch.js
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-08-04 04:35:44 -0400
committerLLLL Colonq <llll@colonq>2026-08-04 04:35:44 -0400
commit3c7796f066647090ed8436778bdfe25f11844c05 (patch)
tree0644a101004d91af4fcdc2f51fcc2e03f7f255ce /2026/games_submissions/cammymoop/js/stopwatch.js
parenta75221ab93f59d688f90cd83f0284ff98951fcfa (diff)
Prepare for upload
Diffstat (limited to '2026/games_submissions/cammymoop/js/stopwatch.js')
-rw-r--r--2026/games_submissions/cammymoop/js/stopwatch.js59
1 files changed, 0 insertions, 59 deletions
diff --git a/2026/games_submissions/cammymoop/js/stopwatch.js b/2026/games_submissions/cammymoop/js/stopwatch.js
deleted file mode 100644
index 4578ee9..0000000
--- a/2026/games_submissions/cammymoop/js/stopwatch.js
+++ /dev/null
@@ -1,59 +0,0 @@
-
-M.Stopwatch = class extends Phaser.GameObjects.Container
-{
- constructor(scene, totalSeconds, pos) {
- super(scene);
- this.setPosVec(pos);
-
- this.elapsed = 0;
- this.totalSeconds = totalSeconds;
-
- this.frame = new Phaser.GameObjects.Image(scene, 0, -3, 'stopwatch_frame');
- this.add(this.frame);
- this.tens = new Phaser.GameObjects.Image(scene, 0, 0, 'stopwatch_numbers', 0);
- this.add(this.tens);
- this.tens.setOrigin(1, 0.5);
- this.ones = new Phaser.GameObjects.Image(scene, 0, 0, 'stopwatch_numbers', 0);
- this.add(this.ones);
- this.ones.setOrigin(0, 0.5);
-
- this.addToDisplayList();
- this.addToUpdateList();
- this.showNumber(totalSeconds - 1);
- }
-
- pause() {
- this.removeFromUpdateList();
- }
-
- resume() {
- this.addToUpdateList();
- }
-
- getTimeLeft() {
- return this.totalSeconds * 1000 - this.elapsed;
- }
-
- setupHint(height, hintData) {
- this.addHintData(hintData);
- this.hint.y = -height;
- }
-
- preUpdate (t, dt) {
- this.elapsed += dt;
-
- const dispSeconds = Math.max(0, Math.floor(this.totalSeconds - (this.elapsed / 1000)));
- this.showNumber(dispSeconds);
-
- if (this.elapsed / 1000 > this.totalSeconds) {
- this.scene.nowFinished(false, true);
- this.pause();
- }
- }
-
- showNumber(dispNumber) {
- const num = Math.round(dispNumber) % 100;
- this.tens.setFrame(Math.floor(num / 10));
- this.ones.setFrame(num % 10);
- }
-};