Hello guys,
first post here! A friend of mine an I are working together on a game, and for debugging purposes, I want to be able to skip out of the love.update function. So my question is: Is this possible, and if yes, how would I do it?
TIA!
How do I skip out of the love.update function?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How do I skip out of the love.update function?
Welcome!
What do you mean by "skip out of love.update"? Do you mean returning in the middle of the function?
Maybe you could describe the kind of effect you want to have.
What do you mean by "skip out of love.update"? Do you mean returning in the middle of the function?
Maybe you could describe the kind of effect you want to have.
Help us help you: attach a .love.
Re: How do I skip out of the love.update function?
As Robin says, you can call "return" to skip out of the function at any place.
If you simply want to skip the function, then I suggest using a gamestate for that, i.e. a variable containing a string that tells you, what state you are in.
Then write in the beginning of the love.update:
If you simply want to skip the function, then I suggest using a gamestate for that, i.e. a variable containing a string that tells you, what state you are in.
Then write in the beginning of the love.update:
Code: Select all
function love.update(dt)
if state = 'skip' then
return
end
...
end
Check out my blog on gamedev
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How do I skip out of the love.update function?
Do replace = by ==.micha wrote:Then write in the beginning of the love.update:
Help us help you: attach a .love.
Re: How do I skip out of the love.update function?
Thanks.Robin wrote:Do replace = by ==.
Check out my blog on gamedev
Who is online
Users browsing this forum: Bing [Bot] and 1 guest