Usual code in draw function

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
chris
Prole
Posts: 17
Joined: Sat Sep 20, 2008 5:48 am

Usual code in draw function

Post by chris »

Because I like my script to contain as less code as possible, I currently implemented a little bit of code that isnt dedicated to drawing, in the love.draw() function.

Is this wrong, does this have consequences, or does it just not matter?
User avatar
slime
Solid Snayke
Posts: 3144
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Usual code in draw function

Post by slime »

Nothing should explode in your face, however it's generally good practice to only have drawing-related code being called in love.draw, with everything else going in love.update or similar places.
GloryFish
Prole
Posts: 19
Joined: Tue Jan 11, 2011 4:43 pm

Re: Usual code in draw function

Post by GloryFish »

What is the code?

I tend to keep code that changes the game state in update(). However, having a chunk of code that does some light drawing specific calculation isn't so bad.
chris
Prole
Posts: 17
Joined: Sat Sep 20, 2008 5:48 am

Re: Usual code in draw function

Post by chris »

Ooh, ok, thanks :P

It's indeed some draw-specific code,
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 2 guests