Skip to content

Commit

Permalink
Customer drag hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Matojeje committed Aug 20, 2024
1 parent 2da685a commit efae598
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Binary file modified src/assets/images/temp/boykisser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/components/Customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,27 @@ export class Customer extends Button {

this.bindInteractive(this.sprite, true);
this.sprite.input!.enabled = false;

this.on("down", () => {
setTimeout(() => {
if (!this.dragged) {
this.scene.addEffect(new TextEffect(
this.scene,
this.x - 70 + Math.random() * 80,
this.y - 80,
"Drag me!",
"black",
30,
false,
"red",
800,
100,
0.7,
0
));
}
}, 200);
})
}

update(time: number, delta: number) {
Expand Down Expand Up @@ -284,6 +305,7 @@ export class Customer extends Button {
this.toggleTimer();
}


onOut(pointer: Phaser.Input.Pointer, event: Phaser.Types.Input.EventData) {
super.onOut(pointer, event);
this.untoggleTimer();
Expand Down

0 comments on commit efae598

Please sign in to comment.