<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Classes in Lua (A little help)]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=743&amp;type=atom"/>
	<updated>2013-08-26T21:42:14Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=743</id>
		<entry>
			<title type="html"><![CDATA[Re: Classes in Lua (A little help)]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4778#p4778"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>anael wrote:</cite><blockquote><p>did you look at this exemple in the wiki ?<br /><a href="http://wiki.maratis3d.org/index.php?title=Lua_object_programming_example">http://wiki.maratis3d.org/index.php?tit &#133; ng_example</a></p><p>I made it to show how to create a class-like object.</p></blockquote></div><br /><p>Hehe. I guess I didn&#039;t read that part. Thank you!!</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-08-26T21:42:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4778#p4778</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Classes in Lua (A little help)]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4774#p4774"/>
			<content type="html"><![CDATA[<p>did you look at this exemple in the wiki ?<br /><a href="http://wiki.maratis3d.org/index.php?title=Lua_object_programming_example">http://wiki.maratis3d.org/index.php?tit &#133; ng_example</a></p><p>I made it to show how to create a class-like object.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-26T20:24:45Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4774#p4774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Classes in Lua (A little help)]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=4735#p4735"/>
			<content type="html"><![CDATA[<p>I guess classes aren&#039;t a part of lua, but I found a tutorial on youtube that shows you how to fake it. And it fakes it really well:</p><p><a href="https://www.youtube.com/watch?v=jq58moMWlT8">https://www.youtube.com/watch?v=jq58moMWlT8</a></p><p>But! I modified his example a little, and I need suggestions on how to make it more authentic (If it can be any more authentic):</p><p>--New Person Class<br />function newPerson(name,age)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; local object = {}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; object.name = name<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; object.age = age<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function object:sayName()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print (object.name)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return object<br />end</p><p>--Create Joe<br />local joe = newPerson(&quot;Joe&quot;,24)</p><p>--Create Bill<br />local bill = newPerson(&quot;Bill&quot;,25)</p><p>--Print Joe&#039;s name<br />print (joe.name)</p><p>--Make Bill say his name<br />bill:sayName()</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-08-23T05:56:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=4735#p4735</id>
		</entry>
</feed>
