Trying to optimize game :c

Basically, I have no idea how to optimize my code without breaking it, for some reason there are random lag spikes, happened ever since i added background music. I’ve cut down on code that runs on game updates yet nothing changes. pls help any1 :cry:

A to skip cutscene

hold a for gun

b for missile

a+b to flare for IR missiles (does not work mobile rn)

wasd to control (suggest using arrow keys)

@2cool4u it’s because you’re pausing inside of “on game update”

all the code in on game update needs to run each frame before the game is drawn to the screen. if you pause, it will freeze your game on that frame until the pause completes.

the fix here is to either put those repeat blocks into a “separately do” block from the timers extension, or use a forever block instead of an “on game update”

2 Likes

(post deleted by author)

How can authors delete posts?! i havent seen anything like that for me…

Maybey because youre a new user? I actually dont know if the trash icon appears for new users