From 992b3656b881dc37b7f7b01ad4504029716778de Mon Sep 17 00:00:00 2001 From: Lumie Date: Sun, 18 Aug 2024 10:11:36 -0700 Subject: [PATCH] leaving sounds, customer payment vs dash i --- src/components/Customer.ts | 11 +++++++++++ src/scenes/GameScene.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/Customer.ts b/src/components/Customer.ts index ab4a1b2..1be5c94 100644 --- a/src/components/Customer.ts +++ b/src/components/Customer.ts @@ -146,6 +146,17 @@ export class Customer extends Button { this.angryImage.setVisible(this.patience <= 0.5); if (this.patience <= 0) { + if(this.hasCompleted){ + if(Math.random()>0.2){ + this.scene.sound.play("cashmoney"); + this.scene.addEffect(new TextEffect(this.scene, this.x-70+(Math.random()*80), this.y-80, "+" + this.moneySpent +" €", "yellow", 40, true, "red", 800, 100, 0.7, 0)); + this.emit("pay", this.moneySpent); + } else { + this.scene.sound.play("fail"); + } + } else { + this.scene.sound.play("fail"); + } this.leave(); this.thoughtBubble.showSymbol("sad"); this.emit("angry"); diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index 933be39..2b9158d 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -306,8 +306,8 @@ export class GameScene extends BaseScene { } endDay() { + //this.stations.forEach((s) => s.returnItems()); this.employees.forEach((e) => e.walkTo(e.startX, e.startY)); - this.setState(GameState.Shopping); }