Page 1 of 1

Usual code in draw function

Posted: Tue Feb 22, 2011 8:10 pm
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?

Re: Usual code in draw function

Posted: Tue Feb 22, 2011 8:17 pm
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.

Re: Usual code in draw function

Posted: Tue Feb 22, 2011 9:09 pm
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.

Re: Usual code in draw function

Posted: Wed Feb 23, 2011 3:14 pm
by chris
Ooh, ok, thanks :P

It's indeed some draw-specific code,