Could someone help me make this project not lag as much?

What's problem you are encountering?
My program is lagging a considerable amount when and only when the player moves forward. I have to have the if statements there though, or programming walls won't be possible.
What have you tried that didn't work?
Moving the if statements to a different script
Post a project example, link, or screenshot:
I wanted this to be a surprise, but link
You use wasd or arrow keys to move

A lot of the lag comes from the untitled script pic (1) blocks, which are quite slow. If there is a way to remove them and check for collision with a sprite, or check the coordinates like untitled script pic (2), it would run much faster.

Hmm, I was going to object about something but I think I found a solution for that. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.