Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Classes/OOP in LUA - Programming Tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,198
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 2, 2011

Here, We learn how to do a simple class setup in LUA.

We use a simple C# example, and convert it into the lua language, Lua doesn't have a built in class function. So, we must create our own. And this video explains how each part works. With lua being more dynamic (less explicit) than C#, its possible to make your own style class systems.

To understand this you will need;
- A basic understanding of C# and its classes.
- A basic/advanced understanding of lua syntax.
- A simple understanding of OOP and Classes.

Notes:
- Pause the video at any time to read whats on the screen. It goes by quick.
- In Notepad++ the edges of some of the comments got cut off. Sorry.
- No music or anything. I couldn't see a need for it.

Hope this helps you understand a bit better.

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (18)

Sign In or Sign Up now to post a comment!
  • public getName()

    it should be

    public string getName()

  • @kllr101 Ok, well, I suppose the video was for people who learning Lua, and since Lua is an "easy" language its probebly the "watchers"(the people who watch the video) first programming language and that means they cant tell what they want in the next tutorial. So its up to the "teacher". BTW its good you made the video :D, there arent many Lua tutorials on YouTube.

  • @ImKalleR Well that's just that, I didn't know what you (or MegaGrance) meant by "in-depth", after all, this is YouTube. I'm not sure whether I'll make another programming tutorial, but if I do, I'll take what you suggested into account (using voice over and putting explanations in the description)

  • @kllr101 well, what I know about OOP it can be covered in just 3 videos, but then i meant in-depth i didnt mean in-depth like in the books, i meant like for being youtube, cause we all know that if you want a real professional in-depth explenation you need to buy a course or study some books (not just one of-course) btw if you make another tutorial plz record youre self talking AND have a text tutorial in the description couse its better. And i am sorry about my language im a n00b...

  • @ImKalleR A more "in-depth" tutorial could mean anything, I was just asking if he wanted a more specific use or attribute of Objects and OOP to be covered. For all I know he might want to know how to do inheritance or other ways of instancing, where I might babble on about say, abstraction in another tutorial.

    I can do a simple one that starts to cover basic principles of OOP in Lua (such as here) but past here it becomes a very wide topic that I couldn't possibly cover in 1 video.

  • @tallibba Well yes, but again, this was only to show simple ways to be able to get a form of object-orientated programming in Lua. It wasn't really to show full classes or inheritance, otherwise I would've used Metatables to do it.

    I've found most of the time, This method will usually be fine for a simplistic "class" setup.

    But you're free to disagree and stick with Metatables for them.

  • @kllr101 Without metatables you are just creating a new table.

    You can't use inheritance.

    You are overheading(Hard).

    This is not a class this is just a table.

    lua-users. org/wiki/SimpleLuaClasses

  • @tallibba There really was no need for anything more complex than a basic table and functions for what was being demonstrated.

  • This was SSOOO helpful, thank you!

  • @MegaGrance Someone found this video helpful! wow.

    I may make another tutorial on lua classes, but what parts would you like to be covered in it?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more