Video Tutorials!

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
sanjiv
Citizen
Posts: 88
Joined: Mon Feb 27, 2012 5:11 am

Re: Video Tutorials!

Post by sanjiv »

Thanks for the advice a few posts up! 'requiring' stuff from other files has really made it easier for me to keep track of what I'm doing.

A new thing that's bugging me is that I've never really gotten a handle on the whole self.something that comes up a lot in tutorials. What does it mean? Right now I've got a handle on creating dog={} and then giving it a dog.bone='value', and so on. So dog.height, dog.weight. or even dog.ear.left makes sense to me....But is there ever a magical moment where I'd say

Code: Select all


function dog.wagTail()
     self.tail='wagging'
end

User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Video Tutorials!

Post by MarekkPie »

This is the way Lua handles classes (or prototypes to be more correct). If you don't know what classes are, search Google for object-oriented programming.

You usually see self associated with a function that is using the ':' operator. See this thread for an explanation of what it is doing.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Video Tutorials!

Post by MarekkPie »

This is the way Lua handles classes (or prototypes to be more correct). If you don't know what classes are, search Google for object-oriented programming.

You usually see self associated with a function that is using the ':' operator. See this thread for an explanation of what it is doing.
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: Video Tutorials!

Post by Qcode »

Possibly tutorials on simple games to remake like pong or snake.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Video Tutorials!

Post by MarekkPie »

There's a pong tutorial on the HardonCollider GItHub. As for something independent of a collision library, there are plenty of pong tutorials in other languages; the good ones should explain how to do it without constraining themselves to a single language.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Video Tutorials!

Post by Robin »

So in a nutshell:

Code: Select all

function dog:wagTail()
     self.tail='wagging'
end
means

Code: Select all

function dog.wagTail(self)
     self.tail='wagging'
end
and if you call it like this:

Code: Select all

dog:wagTail()
it's actually:

Code: Select all

dog.wagTail(dog)
But if you are just using a single table, you don't need it. It becomes useful in object orientation, like MarekkPie said.
Help us help you: attach a .love.
User avatar
baconhawka7x
Party member
Posts: 491
Joined: Mon Nov 21, 2011 7:05 am
Location: Oregon, USA
Contact:

Re: Video Tutorials!

Post by baconhawka7x »

Qcode wrote:Possibly tutorials on simple games to remake like pong or snake.
I'm trying my best to avoid physics as much as possible. But thanks for the post, because I think im going to use snake for my examples in the tutorials!:D
User avatar
semihmasat
Prole
Posts: 27
Joined: Sun Mar 04, 2012 2:38 am

Re: Video Tutorials!

Post by semihmasat »

When we can see the tutorial?

cant wait :)
You must pay for your crimes against the earth.
User avatar
baconhawka7x
Party member
Posts: 491
Joined: Mon Nov 21, 2011 7:05 am
Location: Oregon, USA
Contact:

Re: Video Tutorials!

Post by baconhawka7x »

semihmasat wrote:When we can see the tutorial?

cant wait :)
Hopefully tomorow(march 5th) in the afternoon!:D It's just going to be a basic tutorial for absolute beginners though!
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Video Tutorials!

Post by coffee »

baconhawka7x wrote:
semihmasat wrote:When we can see the tutorial?

cant wait :)
Hopefully tomorow(march 5th) in the afternoon!:D It's just going to be a basic tutorial for absolute beginners though!
So "hopefully tomorrow at afternoon (March 5th)" that was already wrote at March 6th. Odd. Before that you told
**UPDATE** 2/4/2012
the first tutorial(for absolute begginers) should be up by tomorrow!:D
and before when you started the thread you wrote something (and this is from my memory only) "I started today doing"..."what you want to see?" and so on.

baconhawka7x, you starting entering in a vicious cycle of promising and promising dates (and postponing) and even more advanced tutorials when you don't even done the first one. Please, for your credibility and other people's consideration (like semihmasat that is waiting for your tutorials) just stop that nasty habit. If you don't have certain of exactly when it would be released don't keep post "random" dates. It's done when it's done, so just then publish it. Have fun working on those :)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 213 guests