Page 1 of 1

Laggy drawings (new to Love)

Posted: Thu Oct 09, 2014 1:28 am
by Pukeattack
Hi guys, I'm new to using Love and have been having trouble with drawing a background for my game.
I've been trying to draw a relatively small background for my game (800x600) but whenever is draw it, the game lags horribly. I'm not sure what I'm doing wrong or what I can do to fix it. The code goes a bit like this.

function love.draw()
if gamestate == "playing" then
love.graphics.draw(background,0,0)
end
end

Any advice would be appreciated!

Re: Laggy drawings (new to Love)

Posted: Thu Oct 09, 2014 2:12 am
by davisdude
We can't help you without a .love
My guess is that you've put a love.graphics.newImage function inside of love.draw

Re: Laggy drawings (new to Love)

Posted: Thu Oct 09, 2014 3:28 am
by artofwork
Could be a graphics card or cpu issue, I know i have issues loading images as a background, its because my system is a dell dimension p4 pos lol

When your writing out your code and including assets in your application you have to consider your systems limitations.

The way love works is love initially loads whatever is inside of love.load only once and then its a ping pong of loading love.update & love.draw back and forth until your program ends.

So when your drawing something to the screen it isn't just drawn once, it is drawn every other cycle for the life of the program.

Something to keep in mind :)

Re: Laggy drawings (new to Love)

Posted: Fri Oct 10, 2014 10:32 pm
by jjmafiae
There is a chance it's a driver issue but you have probably just screwed up, a .love would help.