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?
Usual code in draw function
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Usual code in draw function
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
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.
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
Ooh, ok, thanks
It's indeed some draw-specific code,
It's indeed some draw-specific code,
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests