Waiting an amount of time
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Waiting an amount of time
Hello, I'm new to Löve but it's been pretty fun to experiment with. Anyway, I've been wondering if there's a method that will wait a certain amount of time before continuing on with the code built in to Löve, and where I can get or code something to do that for me if it's not already implemented into the library. Thanks!
Re: Waiting an amount of time
What exactly do you intend to use this for?
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Waiting an amount of time
Why would you want to pause the whole execution of the program? (That's what you're describing.) Anyway, one way to do it is to redefine love.run to not do anything inside of the while loop. If you're wanting to wait a certain amount of time to perform an action, using timers is the best way. You could write your own, but I would recommend using a library, such as cron.lua or the timers in HUMP.
As for where you can get code that does something that's not implemented into LOVE. There are a large amount of libraries around which are written in Lua. If you need something that must be on the C++ side, you'll have to integrate it yourself into the LOVE source code and compile your own version.
As for where you can get code that does something that's not implemented into LOVE. There are a large amount of libraries around which are written in Lua. If you need something that must be on the C++ side, you'll have to integrate it yourself into the LOVE source code and compile your own version.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Waiting an amount of time
If it truly is your intent to pause execution: love.timer.sleep
And a way to implement it without using the built-in sleep function would be to busy-wait and check the time.
And a way to implement it without using the built-in sleep function would be to busy-wait and check the time.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Waiting an amount of time
Totally forgot about that one.TechnoCat wrote:If it truly is your intent to pause execution: love.timer.sleep
Who is online
Users browsing this forum: Bing [Bot] and 1 guest