Laggy game
Re: Laggy game
If your map its too huge then maybe you need to render only the tiles that can be seen on the screen.Using a nested for loop on x,y axes
Twitter: https://twitter.com/Murii5
Re: Laggy game
map:setDrawRange(x, y, width*, height**)Eamonn wrote:I know what is it: Your map is HUGE! You're rendering too much of the map at once. I had the same problem. You may not realise it, but your map is 800x600. Yes, that's the size of your window, but each of your tiles is 32x32. You don't need all that space. Make your map smaller.
If you want that insanely huge map, just limit the draw range. That being said, I think your map is just too big. Make a new map, and leave it at the default size. You should be alright. If your map was smaller, you'd just have to limit the draw range.
If someone wants to say how to limit the draw range to fix this problem, be my guest. I divided the bounds by about 100,000,000 and it still froze. I think this is because ATL is having trouble loading in a map of that scale. I'm sure there's a way to have maps this big, but it's just not what you'd want.
So yeah: Make your map smaller.
Also, if your having trouble like this, do some deduction. That basically means comment out bits of code that you think might be causing the problem. If you're using a Map, check it's size. Remember: ATL is not an official part of LÖVE, and is a 3rd-party extension.
* Or as I do it, Amount of tiles * tile width
** Or as I dot it, amount of tiles * tile height
Who is online
Users browsing this forum: Bing [Bot] and 9 guests