Loops
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Loops
I was looking for loops on wiki, on forums and I didnt found anything. So I ask: Do in Löve exist loops? I mean for, while etc. Thanks for answers.
My arrowfish doesn't want to be in one picture with OBEY. So I putted it into my signature.
Re: Loops
Yes, they do. LÖVE uses Lua, which has loops built-in.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Loops
As anjo said, LOVE uses Lua (a programming language). I recommend learning the fundamentals of it before starting out. Programming in Lua is how I learned Lua.
Re: Loops
I found it. Thx, BlackBulletIV.
So, these are loops? I find it confusing. Im not wont to programm in this.
http://www.lua.org/pil/4.3.3.html - this is like do while?
http://www.lua.org/pil/4.3.2.html
http://www.lua.org/pil/4.3.4.html
http://www.lua.org/pil/4.3.5.html - this is like foreach?
So, these are loops? I find it confusing. Im not wont to programm in this.
http://www.lua.org/pil/4.3.3.html - this is like do while?
http://www.lua.org/pil/4.3.2.html
http://www.lua.org/pil/4.3.4.html
http://www.lua.org/pil/4.3.5.html - this is like foreach?
Last edited by Batrachus on Sat Apr 16, 2011 9:21 am, edited 1 time in total.
My arrowfish doesn't want to be in one picture with OBEY. So I putted it into my signature.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Loops
Yes those are loops. You'll get used to it .
4.3.3 is like:
4.3.2 is obvious.
4.3.4 is like:
4.3.5 works off iterator functions. Read up on iterators to learn more. So it's closest relative in the Cish languages is foreach.
4.3.3 is like:
Code: Select all
do
{
// ...
} while !condition;
4.3.4 is like:
Code: Select all
for (double i = start; i <= end; i += countBy)
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Loops
On my love tile tutorial I have a section speaking about loops. I'll leave it here in case it is useful.
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 4 guests