From b1aba786045d8d7b9960018ecc0714c6150c5dc0 Mon Sep 17 00:00:00 2001 From: Lumie Date: Sun, 18 Aug 2024 11:53:00 -0700 Subject: [PATCH] better patience bars --- src/assets/assets.ts | 6 +- src/assets/images/temp/defaultsparks.png | Bin 0 -> 8794 bytes src/assets/images/temp/ellipse.png | Bin 0 -> 1362 bytes src/assets/images/temp/greensparks.png | Bin 0 -> 9875 bytes src/assets/images/temp/redsparks.png | Bin 0 -> 9060 bytes src/components/Customer.ts | 49 ++++++- src/components/PatienceTimer.ts | 168 +++++++++++++++++++++++ src/scenes/GameScene.ts | 15 ++ 8 files changed, 233 insertions(+), 5 deletions(-) create mode 100644 src/assets/images/temp/defaultsparks.png create mode 100644 src/assets/images/temp/ellipse.png create mode 100644 src/assets/images/temp/greensparks.png create mode 100644 src/assets/images/temp/redsparks.png create mode 100644 src/components/PatienceTimer.ts diff --git a/src/assets/assets.ts b/src/assets/assets.ts index 9f53d73..d3868fe 100644 --- a/src/assets/assets.ts +++ b/src/assets/assets.ts @@ -102,7 +102,11 @@ const spritesheets: SpriteSheet[] = [ spritesheet('temp/pillowtalk', 'pillowtalk', 100, 100), spritesheet('temp/shuriken', 'shuriken', 100, 100), spritesheet('temp/redx', 'redx', 64, 64), - + spritesheet('temp/anger', 'anger', 64, 64), + spritesheet('temp/ellipse', 'ellipse', 64, 64), + spritesheet('temp/redsparks', 'redspark', 64, 64), + spritesheet('temp/greensparks', 'greenspark', 64, 64), + spritesheet('temp/defaultsparks', 'defaultspark', 64, 64), spritesheet('temp/blankspr', 'blankspr', 100, 100), ]; diff --git a/src/assets/images/temp/defaultsparks.png b/src/assets/images/temp/defaultsparks.png new file mode 100644 index 0000000000000000000000000000000000000000..069783cbd3ac1838663c606d12b6130dbdb5e27d GIT binary patch literal 8794 zcmeHNc{tQ-`yWfTERmfwmI@g&7|RS}-?J};kTEkDhMCM@D1<_BqJ#+9DTS=r_fR5a zDOpO{l0C}SZ>V!l=l7oXyuWi@zxTg0*ERE<=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 literal 0 HcmV?d00001 diff --git a/src/assets/images/temp/redsparks.png b/src/assets/images/temp/redsparks.png new file mode 100644 index 0000000000000000000000000000000000000000..9e399acbe00bb715721ef93b58d36dee9207f5bb GIT binary patch literal 9060 zcmeHNc{tSVyC0NYwk)9;C7Pn06Jy84t_zRmd8tzTdmUq%AV5BInf|?gHsx5d9(0s1IA(F&s4JpcN#di zwrRtj><+w-3TfP0{Bl>v)B0n|?JGj@sxv)R_1`@iVE!moQ5oqEpmA&5m#<%nIg-`e z#COXJmx8Q9>kY$FiYKmu7D>93QBG0sLhE;zzgp}GY%ghT_jNsK9G`YlcgdewUku(G zuLF+;ov!1*$KJbEQSb%a=;xrsP*Xp`$2wiLa(*KB>tjG5kNAXlTPNz?9T@x5g1k(< z+S&TSbZ$ebP4u+?`-U}f0aN#ZiMpl z3wVdd-jEMLzVsG?ym=OrK4?-bJmy5h2KrbcCBkql4va7c>%Ouz2PNr+($XA@xhg7d zQ1S7V1c@CdbTI)*`21$IDV%Z=<6w0Go+&&xZ+s0U1gwhg>TK=@s=6wJ--p~LaMA= z!Do1ZBsE#~qVOTuk=x1%H3R0qGlZY799vhK1>7?~tG4*5w6CXHWAO#JYTWnR@S@*# zhaF>9`EK9TM33F~ZoAN%D@@NhKV^n=+k=1sj zL_zY5|FIR=YPMd^cJ<^?hl0b~-NnJBtnsBinjIFJ#fq0wen5DTe_CD zg{}7jSD%-ni~1CYjD7NpE3G=FpLb96>d%*jUn`vvTi5Fk6sSEto0Q+WJl?MUG&W29 z)3*ilMIC6(RVW(B9{q}q?4=1ptpM(1i$#Ye;i!NxmYnlWB5zn;B=Wp>lN+H=ta@LJ-S!> zbSso4*!z;a$FA*pW9-NR|9hp&PxDeQ6RmF@KMRY(JgKZ1#Al4m<*)IS@~tcjbgO;7 z!A}b(IS!1J0~bv)#N8&%4}?J4;D(7p95Cj?tlY56qletIw4R&q{gE^O8MxX8713=Cjc} z{LQh|SLPVSVGo`n(%+ zy(Mh9WeSOEEY}%z(o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|AM1?AeF0O)^%-{Tet^+SnG*nbi<^WaN9k4a=!bcBEF7KvRx8 1) ? 1 : (this.patience / this.maxPatience)); this.angryImage.setVisible(this.patience <= 0.5); - + this.testTimer.update(time,delta); if (this.patience <= 0) { if(this.hasCompleted){ if(Math.random()>0.2){ @@ -160,21 +167,35 @@ export class Customer extends Button { 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"); + this.scene.sound.play("rip"); } } else { - this.scene.sound.play("fail"); + this.scene.sound.play("rip"); } this.leave(); this.thoughtBubble.showSymbol("sad"); this.emit("angry"); } } else { + this.testTimer.update(time,delta); this.patienceTimer.setVisible(false); this.angryImage.setVisible(false); } } + onOver( pointer: Phaser.Input.Pointer, + localX: number, + localY: number, + event: Phaser.Types.Input.EventData){ + super.onOver(pointer,localX,localY,event); + this.toggleTimer(); + } + + onOut(pointer: Phaser.Input.Pointer, event: Phaser.Types.Input.EventData) { + super.onOut(pointer,event); + this.untoggleTimer(); + } + onDragStart(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) { this.emit("pickup"); this.dragged = true; @@ -207,6 +228,22 @@ export class Customer extends Button { } } + toggleTimer(){ + this.testTimer.unveil(); + } + + untoggleTimer(){ + this.testTimer.veil(); + } + + lockTimer(){ + this.testTimer.lockTimer(); + } + + unlockTimer(){ + this.testTimer.unlockTimer(); + } + snapTo(x: number, y: number) { this.dragX = x; this.dragY = y; @@ -231,6 +268,10 @@ export class Customer extends Button { this.sprite.input!.enabled = !employee; + if(employee){ + this.untoggleTimer(); + this.lockTimer(); + } this.thoughtBubble.showSymbol(Phaser.Math.RND.pick(["happy", "love"])); } @@ -297,7 +338,7 @@ export class Customer extends Button { leave() { this.sprite.input!.enabled = false; - + this.testTimer.setVisible(false); this.setRequest(null); this.patienceTimer.setVisible(false); diff --git a/src/components/PatienceTimer.ts b/src/components/PatienceTimer.ts new file mode 100644 index 0000000..61fd1b7 --- /dev/null +++ b/src/components/PatienceTimer.ts @@ -0,0 +1,168 @@ +import { GameScene } from "@/scenes/GameScene"; + +export class PatienceTimer extends Phaser.GameObjects.Container { + private background: Phaser.GameObjects.Image; + private bar: Phaser.GameObjects.Rectangle; + private anger: Phaser.GameObjects.Sprite; + private sparks: Phaser.GameObjects.Sprite + private graphics: Phaser.GameObjects.Graphics; + private size: number; + private color: number; + private veiled: boolean = true; + private vTimer: number = 0; + private vfTimer: number = 0; + private critical:boolean = false; + private DEFAULT_ALPHA: number = 0.8; + private workingAlpha: number = 0.8; + private lock: boolean = false; + + constructor( + scene: GameScene, + x: number, + y: number, + scale: number, + color: number + ) { + super(scene, x, y); + scene.add.existing(this); + + this.scene = scene; + this.scale = scale; + this.color = color; + this.bar = this.scene.add.rectangle(0,-60,16,128,0x00FF00); + this.bar.setOrigin(0.5,0); + this.anger = new Phaser.GameObjects.Sprite(this.scene,0,-80,"ellipse"); + this.sparks = new Phaser.GameObjects.Sprite(this.scene,0,64,"defaultspark"); + this.sparks.setTint(0x00FF00); + this.sparks.setScale(0.5); + + this.add(this.bar); + this.add(this.sparks); + this.add(this.anger); + this.updateAlpha(this.DEFAULT_ALPHA); + //this.background = this.scene.add.image(0, 0, "timer"); + //this.background.setScale(size / this.background.width); + //this.add(this.background); + + this.graphics = this.scene.add.graphics(); + this.add(this.graphics); + this.setVisible(false); + } + + setColor(color: number) { + this.color = color; + } + + update(t:number,d:number){ + if(Math.sin(t/120) > 0){ + this.anger.setFrame(0); + this.sparks.setFrame(0); + } else { + this.anger.setFrame(1); + this.sparks.setFrame(1); + } + + + + if(this.veiled) { + if(this.vTimer > 0) { + this.vTimer -= d; + if(this.vTimer <= 0) { + this.setVisible(false); + this.updateAlpha(this.DEFAULT_ALPHA); + this.vTimer = 0; + } else { + this.updateAlpha(this.DEFAULT_ALPHA*this.vTimer/500); + } + } + } else if (!this.veiled) { + if(this.vfTimer > 0) { + this.vfTimer -= d; + if(this.vfTimer <= 0) { + this.vfTimer = 0; + this.updateAlpha(this.DEFAULT_ALPHA); + } else { + this.updateAlpha(this.DEFAULT_ALPHA*((200-this.vfTimer)/200)); + } + } + } + } + + lockTimer(){ + this.lock = true; + } + + unlockTimer() { + this.lock = false; + } + + unveil(){ + if(this.lock) { + return; + } + this.setVisible(true); + this.vTimer = 0; + this.vfTimer = 200; + this.veiled = false; + } + + veil(){ + if(this.lock){ + return; + } + this.updateAlpha(this.DEFAULT_ALPHA); + this.vTimer = 500; + this.veiled = true; + } + + updateAlpha(n: number){ + this.sparks.setAlpha(n); + this.bar.setAlpha(n); + this.anger.setAlpha(n); + } + + resetAlpha(){ + if(this.critical){ + this.sparks.setAlpha(1); + this.bar.setAlpha(1); + this.anger.setAlpha(1); + } else { + this.sparks.setAlpha(0.5); + this.bar.setAlpha(0.5); + this.anger.setAlpha(0.5); + } + } + + redraw(factor: number) { + + /* + const radius = 0.24 * this.size; + const border = 0.055 * this.size; + + this.graphics.clear(); + this.graphics.beginPath(); + this.graphics.fillStyle(this.color); + this.graphics.moveTo(0, 0); + this.graphics.arc( + 0, + 0, + radius - border, + -Math.PI / 2, + -Math.PI / 2 + factor * 2 * Math.PI + ); + this.graphics.closePath(); + this.graphics.fillPath(); + */ + this.bar.setScale(1,factor); + this.sparks.setY(-64+(128*factor)); + if((factor < 0.5) && !(this.critical)){ + this.critical = true; + this.anger.setTexture("anger"); + this.sparks.setTint(0xFF0000); + this.sparks.setAlpha(1); + this.bar.setAlpha(1); + this.anger.setAlpha(1); + this.bar.fillColor = 0xFF0000; + } + } +} diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index ed3f541..09ec7e3 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -325,6 +325,7 @@ export class GameScene extends BaseScene { if (customer && employee) { customer.setAction(false); customer.setEmployee(null); + customer.unlockTimer(); employee.setAction(false); employee.setCustomer(null); @@ -453,6 +454,20 @@ export class GameScene extends BaseScene { } }); + /* + + customer.on("over", () => { + customer.toggleTimer(); + this.sound.play("meme_explosion_sound"); + }); + + customer.on("out", () => { + customer.untoggleTimer(); + }); + */ + + + // Customer leaving the game customer.on("offscreen", () => { this.customers = this.customers.filter((c) => c !== customer);