How do I skip out of the love.update 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
aeTIos
Prole
Posts: 3
Joined: Wed May 08, 2013 6:17 pm

How do I skip out of the love.update function?

Post by aeTIos »

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!
User avatar
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?

Post by Robin »

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.
Help us help you: attach a .love.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: How do I skip out of the love.update function?

Post by micha »

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:

Code: Select all

function love.update(dt)
if state = 'skip' then
  return
end
...
end
User avatar
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?

Post by Robin »

micha wrote:Then write in the beginning of the love.update:
Do replace = by ==.
Help us help you: attach a .love.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: How do I skip out of the love.update function?

Post by micha »

Robin wrote:Do replace = by ==.
Thanks.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 9 guests