Laggy drawings (new to Love)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Pukeattack
Prole
Posts: 3
Joined: Fri Jun 07, 2013 6:37 pm

Laggy drawings (new to Love)

Post 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!
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Laggy drawings (new to Love)

Post 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
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
artofwork
Citizen
Posts: 91
Joined: Mon Sep 15, 2014 1:17 am
Location: East Coast USA

Re: Laggy drawings (new to Love)

Post 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 :)
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Laggy drawings (new to Love)

Post by jjmafiae »

There is a chance it's a driver issue but you have probably just screwed up, a .love would help.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests