Hello, I am new to LÖVE and I have a question.
How can I have a exit command that will work (either press exit in game or click the x)
I have a looping command that waits 30 seconds between every command sent too.
This is what I want (Just an example, I have the code already)
[loop1]
while wloop == 1 do
os.execute("code goes here")
love.timer.sleep(30)
end
function love.quit()
-- quit command goes here
end
Looping Help?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Looping Help?
Meaning this ?Candunc wrote:Hello, I am new to LÖVE and I have a question.
How can I have a exit command that will work ...
Code: Select all
love.event.push ('quit')
See love.event.push on the wiki, BTW.
EDIT: See also love.event.quit
Re: Looping Help?
No, I have the code, I just need help with having it execute. The 30 second wait time freezes LÖVE so that no command will work, making it unable to quit.Roland_Yonaba wrote:This is legible with love 0.8.0, though.Code: Select all
love.event.push ('quit')
See love.event.push on the wiki, BTW.
EDIT: See also love.event.quit
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Looping Help?
I am not sure on what you need for. Maybe its delaying.
If so, you you queue your commands in a table, map each one with a delay time, a execute them according to timer.
Possible ways of doing this are listed here: viewtopic.php?f=4&t=10585
If so, you you queue your commands in a table, map each one with a delay time, a execute them according to timer.
Possible ways of doing this are listed here: viewtopic.php?f=4&t=10585
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Looping Help?
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 5 guests