generated from GalKJ/week5-clientside-GullyMans
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
You're using a setTimeout here to delay the cpu's move attack/heal. This isn't immediately obvious to the player playing as banana joe so they may not wait and continue to click on attack/heal only to suddenly see their own health (seemingly) randomly decrease when the cpu's timer finally fires and they attack.
A potential way to improve the user experience would be to hide the attack/heal buttons temporarily and then show sometging to indicate that the game is waiting for the cpu to take their turn.
week5-clientside-GullyMans/src/App.jsx
Lines 29 to 34 in d99e3bc
| setTimeout(() => { | |
| const cpuFuncs = [CpuAttack, CpuHeal]; | |
| const randomCpuFunc = cpuFuncs[Math.floor(Math.random() * 2)]; | |
| randomCpuFunc(); | |
| }, 5000); | |
| }; |
Metadata
Metadata
Assignees
Labels
No labels