Hello everone, I'm new here. I have some problems, but the worst is:
I dont know how to use class! You can see in my signature "I'm Programmer", but I'm know only basics of C++(Maybe little more then basics^^), Visual Basic, C# and LUA, but thhis classes just make me so angry... Anyway, Someone can explain for me how to use classes? (I just drank too much coffee today, so I can't say this easier)
Someone can help with classes?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- LinaInverse
- Prole
- Posts: 5
- Joined: Tue Feb 03, 2009 3:54 am
- Location: SteamID: SuperOwca
Someone can help with classes?
I'm Girl, I'm Blonde, I'm Programmer, MayBe Even Gamer (Who Like To Play Left4Dead?)
Re: Someone can help with classes?
Hi LinaInverse, welcome
The crazy thing about lua is that it doesn't have classes. However, it does have tables, which are sort of like arrays. These tables are not limited to data types, and can contain anything you want, including functions. By stuffing tables with functions, it's possible to make one act like a class.
This article has a very good implementation and explanation.
BTW - everything in lua is passed by reference, so it's like these tables contain pointers to their contents. Good to know.
The crazy thing about lua is that it doesn't have classes. However, it does have tables, which are sort of like arrays. These tables are not limited to data types, and can contain anything you want, including functions. By stuffing tables with functions, it's possible to make one act like a class.
This article has a very good implementation and explanation.
BTW - everything in lua is passed by reference, so it's like these tables contain pointers to their contents. Good to know.
- LinaInverse
- Prole
- Posts: 5
- Joined: Tue Feb 03, 2009 3:54 am
- Location: SteamID: SuperOwca
Re: Someone can help with classes?
Oh, Big Thanks
I'm Girl, I'm Blonde, I'm Programmer, MayBe Even Gamer (Who Like To Play Left4Dead?)
Re: Someone can help with classes?
LinaInverse... you claim to be a girl. Because of the fact that I am a male geek and you have ventured into our hunting grounds, I am obligated by the Board of Male Geekyness, led by the honorable XXXJudgeDoomHammerXXX and overseen by JamesTPicard86, to ask you the following question:
a/s/l ?
a/s/l ?
Now posting IN STEREO (where available)
Re: Someone can help with classes?
Obligatory.
But on a serious note, I say just forget about it. You really don't find people who feel the need to broadcast to everyone their lack of a Y chromosome in their signature annoying?
But on a serious note, I say just forget about it. You really don't find people who feel the need to broadcast to everyone their lack of a Y chromosome in their signature annoying?
Re: Someone can help with classes?
MY.FUCKING.EYES
NEED.SPOON.REMOVE.THEM
AGH.
NEED.SPOON.REMOVE.THEM
AGH.
Teh Blog -> http://cryodreams.com.ar
- qubodup
- Inner party member
- Posts: 775
- Joined: Sat Jun 21, 2008 9:21 pm
- Location: Berlin, Germany
- Contact:
Re: Someone can help with classes?
oh $dog you idiot, you walked right into it. dude. how many years have you been on the internet?
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 0 guests