Things you should bear in mind when making your game a fast as possible. Like how to handle variables, loops, tables, garbage collection...
These are things I've found already:
Use as much locals as possible and reuse them, turn globals into locals
Code: Select all
WRONG WAY
for i=1,1000000 do
localx = math.sin(i)
end
RIGHT WAY
local sin = math.sin
for i=1, 1000000 do
localx = sin(i)
end
love.timer.getFPS()
seems to lower performance on itsself by using it.
When using mapscrolling or simular things you shouldn't draw things which are outside the visible windowscreen.
Are there other tips people and myself should know about?