Page 1 of 1

Performance issues

Posted: Wed Jul 27, 2016 7:57 pm
by napolux
I'm in the process of creating a tetris clone (YAY!). I'm now at a point where I can move pieces around, but I begin to see performance issues with points where I reach the low 4/5 FPS and of course this can't be acceptable.

I'm pretty new to Löve, but I was wondering if I'm doing something wrong or not.
You can find the whole code here: https://github.com/napolux/tile4up

But the main stuff is here: https://github.com/napolux/tile4up/blob ... s/game.lua

I don't know if I'm organizing my code well or I am missing something... Any idea?

Re: Performance issues

Posted: Wed Jul 27, 2016 8:41 pm
by rxi
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!
https://love2d.org/wiki/love.graphics.newImage