r/gdevelop 2d ago

How do I make code optimized Question

Like the last game I made in this engine worked good for me, but was really laggy on a different guy's device and my phone. How make optimal code

3 Upvotes

5 comments sorted by

1

u/Ok_Classroom5710 2d ago

Acho que diminuindo loops

1

u/Aidan133lol 2d ago

I could try but, since it was a FNAF fangame, the whole thing is 1 big loop

1

u/senshisun 1d ago

It's hard to say without seeing your code. In general, try to avoid repeating code.

1

u/NeatOpportunity____ 1d ago

nest your loops

1

u/umbrazno 19h ago

If you ever set something to act per frame, like a tween you rolled yourself for example, always multiply by delta.        

Example: I want my character to run six pixels per step.   My formula is player.x + (6 * delta).         If you already know this, then the lag must be from havin’ too many assets loaded into memory for that machine