Enemies move and towers fire relative to the system clock, but lasers last exactly 20 game loop steps. When there are many enemies [and therefore many lasers] this is enough to affect game performance.
To fix: lasers should be linked to a system time in ms and removed when the time elapsed is too long.
Enemies move and towers fire relative to the system clock, but lasers last exactly 20 game loop steps. When there are many enemies [and therefore many lasers] this is enough to affect game performance. To fix: lasers should be linked to a system time in ms and removed when the time elapsed is too long.