Skip to content

Commit

Permalink
Fill stage to the brim with stuff to see how it feels
Browse files Browse the repository at this point in the history
  • Loading branch information
Golen87 committed Aug 17, 2024
1 parent b0dd419 commit fa41416
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/Station.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class Station extends Button {
text: "Available",
});
this.text.setOrigin(0.5);
this.text.setVisible(false);
this.text.setStroke("#000000", 4);
this.add(this.text);

Expand Down
30 changes: 24 additions & 6 deletions src/scenes/GameScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,25 @@ export class GameScene extends BaseScene {
this.addStation(0, 0, StationType.WaitingSeat);
this.addStation(0, 1, StationType.WaitingSeat);
this.addStation(0, 2, StationType.WaitingSeat);
this.addStation(0, 3, StationType.WaitingSeat);
this.addStation(2, 2, StationType.HornAndNails);
this.addStation(3, 2, StationType.HornAndNails);
this.addStation(4, 2, StationType.HornAndNails);
this.addStation(2, 0, StationType.HornAndNails);
this.addStation(3, 0, StationType.HornAndNails);
this.addStation(4, 0, StationType.HornAndNails);
this.addStation(6, 1, StationType.ScalePolish);
this.addStation(7, 1, StationType.ScalePolish);
this.addStation(6, 3, StationType.GoldBath);
this.addStation(7, 5, StationType.CashRegister);
this.addStation(7, 3, StationType.GoldBath);
this.addStation(2, 4, StationType.GoldBath);
this.addStation(3, 4, StationType.GoldBath);
this.addStation(5, 5, StationType.CashRegister);

this.employees = [];
this.addEmployee(0, 5);
this.addEmployee(1, 5);
this.addEmployee(2, 5);
this.addEmployee(3, 5);

this.customers = [];
Expand Down Expand Up @@ -88,6 +99,18 @@ export class GameScene extends BaseScene {
this.endDay();
},
});

// Spawn customers every 3 seconds
this.time.addEvent({
delay: 3000,
callback: () => {
// Spawn new customer if shop is still open
if (this.timeOfDay > 0 && this.getAvailableWaitingSeat()) {
this.addCustomer();
}
},
loop: true,
});
}

endDay() {}
Expand Down Expand Up @@ -206,11 +229,6 @@ export class GameScene extends BaseScene {
customer.on("offscreen", () => {
this.customers = this.customers.filter((c) => c !== customer);
customer.destroy();

// Spawn new customer if shop is still open
if (this.timeOfDay > 0 && this.getAvailableWaitingSeat()) {
this.addCustomer();
}
});

// Customer completing their itinerary and paying
Expand Down

0 comments on commit fa41416

Please sign in to comment.