Re:Show HN: Looptap – A minimal game to waste your time
by ehsankia on Thursday January 13, 2022 @11:49PM
(#29930685)
It is a bit of a slippery slope, because at some point, you could just do "GameApp.AddScore(10000)" which is clearly not playing the game. The line of what's "fair" and what's not isn't too clear. I do think staying out of the game code is actually a fairly good line though.
EDIT: Looked down thread and basically saw a bunch of examples of just that!
Re:Show HN: Looptap – A minimal game to waste your time
by afiori on Friday January 14, 2022 @11:30AM
(#29936542)
I believe that getBoundingClientRect does not force a layout calculation by itself, it only forces queued recalculations to happen synchronously.
So calling it 100 times in a loop should be fast, but calling it 100 times in a loot that also updates the DOM should be cripplingly slow.
Just adding this information for the ones who don't know and like to know more about browser performance :)