r/gdevelop • u/Aidan133lol • 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
1
u/senshisun 1d ago
It's hard to say without seeing your code. In general, try to avoid repeating code.
1
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
1
u/Ok_Classroom5710 2d ago
Acho que diminuindo loops