function love.update()
if key == "9" then
for i = 1,9 do
wait(1)
text = i +1
end
end
end
Why won't it work? I know nothing about love objects =-=
Text?
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: Text?
Yes, please carefully read the forum rules again.
You'll want to use love.keypressed.
Also note there is nothing like "wait(1)" in LÖVE. If it were, doing that would stop everything for a second, completely freezing it, so you can't even close the window. What you do instead is, for example, setting a variable to 0 and adding dt each time in love.update(dt). Once it is larger than the number of seconds you want to wait, you run the code.
You'll want to use love.keypressed.
Also note there is nothing like "wait(1)" in LÖVE. If it were, doing that would stop everything for a second, completely freezing it, so you can't even close the window. What you do instead is, for example, setting a variable to 0 and adding dt each time in love.update(dt). Once it is larger than the number of seconds you want to wait, you run the code.
Help us help you: attach a .love.
Re: Text?
Yes. I tried love.timer.sleep(1) once. I was upset.Robin wrote:Yes, please carefully read the forum rules again.
You'll want to use love.keypressed.
Also note there is nothing like "wait(1)" in LÖVE. If it were, doing that would stop everything for a second, completely freezing it, so you can't even close the window. What you do instead is, for example, setting a variable to 0 and adding dt each time in love.update(dt). Once it is larger than the number of seconds you want to wait, you run the code.
"your actions cause me to infer your ego is the size of three houses" -finley
Re: Text?
You have already asked this question, and it was already answered here:miz656 wrote:function love.update()
if key == "9" then
for i = 1,9 do
wait(1)
text = i +1
end
end
end
Why won't it work? I know nothing about love objects =-=
http://love2d.org/forums/viewtopic.php?f=4&t=4624
BTW, looking at this loop (which is useless, because the text variable will be always set to "10" after it finishes), I think you should define first what do you mean by "work". It surely works, but seems you expect something different, and I (we?) don't quite understand what that could be.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot] and 7 guests