aliciajpan / cake-game

React browser game with custom API
https://overcaked.vercel.app/
0 stars 0 forks source link

Timer expiring one at a time #11

Closed aliciajpan closed 1 month ago

aliciajpan commented 1 month ago

When all same amount of time, one expire at a time: 3rd one expires, first one SOMETIMES restarts timer and then also expires, else both 1st and 2nd just sit there with timers ran out.

Most likely due to nextCakeToDisplay is one cake and not an array (cannot handle many expiring at the same time)

When different amounts of time based on # cake layers, if 3,3,2 - 2 expires before it fully reaches timer bar end?


setup:

symptoms:

investigation:

thoughts:

aliciajpan commented 1 month ago

https://felixgerschau.com/react-hooks-settimeout/#using-state-in-settimeout