That would help to speed things up, but I'm sure there are better ways to make this more efficient, like we always try to do.
![Wink ;)](./images/smilies/ms-wink.png)
When you don't need a certain image, just don't draw it -- not even off screen. That helps.Ertain wrote:When one of the enemies in my little game is destroyed, for example, I just have them moved off the screen. I have been wondering about how to remove the enemy picture, data and all.
Of course, sometimes it can be slower to check for whether an image is in the screen area or not than to just draw it without any checks.Taehl wrote:Yeah. Drawing off the screen is just as slow as drawing on the screen, so to have the best possible framerate, make your game only draw what's visible.
The absolute best way is to use a method that doesn't even have to bother checking for the location of an image. It scales much better.slime wrote:Of course, sometimes it can be slower to check for whether an image is in the screen area or not than to just draw it without any checks.
I would say those are standard problems. I do agree with what was said before, and I would add:Ertain wrote:Hello again, LÖVErs. I have a question about keeping the framerate consistent and making things run smooth. What are some methods for doing this? I have been trying to figure out how not to have so many pictures on the screen (so that it doesn't eat up CPU cycles). When one of the enemies in my little game is destroyed, for example, I just have them moved off the screen. I have been wondering about how to remove the enemy picture, data and all.
That would help to speed things up, but I'm sure there are better ways to make this more efficient, like we always try to do.
At least when drawing rectangles, I found that to be quite the opposite. When a couple hundred rectangles were on-screen, there was a slow down in framerate to the 200s I think. Then it went back up to the high 400s when not so many were around. Again, when drawing rectangles, I found by doing checks on what to draw, I had a frame rate drop of about 40-50 when drawing about 15-20 rectangles. But, it might different for images.Taehl wrote:Yeah. Drawing off the screen is just as slow as drawing on the screen, so to have the best possible framerate, make your game only draw what's visible.
Users browsing this forum: Bing [Bot] and 4 guests