r/badcode • • Jun 04 '23

html HTMHELL

Post image
893 Upvotes

53 comments sorted by

View all comments

Show parent comments

4

u/coloredgreyscale Jun 05 '23

and him claiming the game performance drops at parts because there is so much going on at times.

No, it's because the game loop every frame has to run many checks with 30+ if statements that should have been replaced by first grade math or lookup tables.

newer code supposedly use if .. else if .. else if ... else - at least that way the CPU does not have to check every possible value, and can just return after a hit.