Skip to content

Commit

Permalink
Update sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Golen87 committed Aug 20, 2024
1 parent 7729082 commit 693189c
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 11 deletions.
15 changes: 15 additions & 0 deletions src/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,21 @@ const audios: Audio[] = [
sound('pickupcustomer', 'pickup', 0.5),
sound('dropcustomer', 'drop', 0.5),
sound('tree/meme_explosion_sound', 'meme_explosion_sound', 0.5),

sound("turtle/air", "air", 0.5),
sound("turtle/flail", "flail", 0.5),
sound("turtle/grab", "grab", 0.5),
sound("turtle/land", "land", 0.5),
sound("turtle/letgo1", "letgo1", 0.5),
sound("turtle/letgo2", "letgo2", 0.5),
sound("turtle/letgo3", "letgo3", 0.5),
sound("turtle/miss", "miss", 0.5),
sound("turtle/missLand", "missLand", 0.5),
sound("turtle/score", "score", 0.5),
sound("turtle/slip", "slip", 0.5),
sound("turtle/toss", "toss", 0.5),
sound("turtle/trick", "trick", 0.5),
sound("turtle/trip", "trip", 0.5),
];

/* Fonts */
Expand Down
Binary file added src/assets/sounds/turtle/air.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/flail.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/grab.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/land.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/letgo1.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/letgo2.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/letgo3.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/miss.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/missLand.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/score.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/slip.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/toss.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/trick.mp3
Binary file not shown.
Binary file added src/assets/sounds/turtle/trip.mp3
Binary file not shown.
20 changes: 11 additions & 9 deletions src/components/Customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class Customer extends Button {
if (this.patience <= 0) {
if (this.hasCompleted) {
if (Math.random() > 0.2) {
this.scene.sound.play("cashmoney");
this.scene.sound.play("cashmoney", { volume: 0.4 });
this.scene.addEffect(
new TextEffect(
this.scene,
Expand All @@ -234,10 +234,10 @@ export class Customer extends Button {
);
this.emit("pay", this.moneySpent);
} else {
this.scene.sound.play("rip");
this.scene.sound.play("rip", { volume: 0.4 });
}
} else {
this.scene.sound.play("rip");
this.scene.sound.play("rip", { volume: 0.4 });
}
this.leave();
this.thoughtBubble.showSymbol("sad");
Expand Down Expand Up @@ -268,7 +268,7 @@ export class Customer extends Button {
}
}
if (this.playFail) {
this.scene.sound.play("rip");
this.scene.sound.play("rip", { volume: 0.4 });
this.playFail = false;
}
}
Expand All @@ -292,6 +292,7 @@ export class Customer extends Button {
this.emit("pickup");
this.dragged = true;
this.sprite.setTexture(this.spriteKeys.sit);
this.scene.sound.play("grab", { volume: 0.5 });
}

onDrag(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) {
Expand All @@ -305,6 +306,7 @@ export class Customer extends Button {
this.dragged = false;
this.emit("drop");
this.sprite.setTexture(this.spriteKeys.sit);
this.scene.sound.play("letgo1", { volume: 0.4 });
}

resetPatience() {
Expand Down Expand Up @@ -443,7 +445,7 @@ export class Customer extends Button {
} else {
this.actionsComplete = true;
this.parseMoney();
this.scene.sound.play("cashmoney");
this.scene.sound.play("cashmoney", { volume: 0.4 });
this.scene.addEffect(
new TextEffect(
this.scene,
Expand Down Expand Up @@ -656,16 +658,16 @@ export class Customer extends Button {
this.parseHappiness();
}

pauseClickable(){
if(!(this.sprite.input!.enabled)) {
pauseClickable() {
if (!this.sprite.input!.enabled) {
this.garchomp = true;
} else {
this.sprite.input!.enabled = false;
}
}

resumeClickable(){
if(this.garchomp) {
resumeClickable() {
if (this.garchomp) {
this.garchomp = false;
} else {
this.sprite.input!.enabled = true;
Expand Down
4 changes: 4 additions & 0 deletions src/components/UpgradeOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ export class UpgradeOverlay extends Phaser.GameObjects.Container {
this.buyButton.on("click", () => {
if (this.selectedStation) {
this.emit("upgradeStation", this.selectedStation);
this.scene.sound.play("score", { volume: 1.0 });
} else {
this.emit("upgradeEmployee", this.selectedEmployee);
this.scene.sound.play("score", { volume: 1.0 });
}
});

Expand Down Expand Up @@ -195,6 +197,7 @@ export class UpgradeOverlay extends Phaser.GameObjects.Container {
alpha: 1,
duration: 200,
});
this.scene.sound.play("flail", { volume: 0.3 });
}
}

Expand All @@ -210,5 +213,6 @@ export class UpgradeOverlay extends Phaser.GameObjects.Container {
this.emit("close");
},
});
this.scene.sound.play("missLand", { volume: 0.2 });
}
}
2 changes: 0 additions & 2 deletions src/scenes/GameScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ export class GameScene extends BaseScene {

// Picking up a customer
customer.on("pickup", () => {
this.sound.play("pickup");
if (customer.currentStation) {
// customer.currentStation.setCustomer(null);
// customer.setStation(null);
Expand All @@ -704,7 +703,6 @@ export class GameScene extends BaseScene {

// Dropping a customer
customer.on("drop", () => {
this.sound.play("drop");
let station = this.getClosestStation(customer);
if (station) {
// Let go of previous station
Expand Down

0 comments on commit 693189c

Please sign in to comment.