<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Lua Classes and Packages in Corona	</title>
	<atom:link href="https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/feed" rel="self" type="application/rss+xml" />
	<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html</link>
	<description>Software &#124; Fitness &#124; Gaming</description>
	<lastBuildDate>Wed, 15 Feb 2012 20:10:57 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: JesterXL		</title>
		<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243085</link>

		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Wed, 15 Feb 2012 20:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=2909#comment-243085</guid>

					<description><![CDATA[@andrea main.lua always goes in your root folder.

For classes, you have 2 options: to use packages or not. Packages are synonymous with folders. If you don&#039;t provide/use a package, then the class goes in root (next to main.lua).

If I make a class, Cow.lua, and save it in root (next to main.lua), then:

&lt;pre lang=&quot;Lua&quot;&gt;Cow = {}
function Cow:new()
    local cow = {}
    return cow
end
return Cow&lt;/pre&gt;

Then anyone, including main.lua and others, can simply go:

&lt;pre lang=&quot;lua&quot;&gt;require &quot;Cow&quot;
local myCow = Cow:new()&lt;/pre&gt;

If, however, you wish to use packages, then it matters where the file Cow.lua goes. If I used com.jessewarden.animals, then I&#039;d:
1. make a folder called &quot;com&quot;
2. inside of &quot;com&quot;, make a folder called &quot;jessewarden&quot;
3. inside of &quot;jessewarden&quot; make a folder called &quot;animals&quot;
4. inside of &quot;animals&quot; put my Cow.lua

Then, whoever wants to use it goes:

&lt;pre lang=&quot;Lua&quot;&gt;require &quot;com.jessewarden.animals.Cow&quot;
local myCow = Cow:new()&lt;/pre&gt;

Make sense?]]></description>
			<content:encoded><![CDATA[<p>@andrea main.lua always goes in your root folder.</p>
<p>For classes, you have 2 options: to use packages or not. Packages are synonymous with folders. If you don&#8217;t provide/use a package, then the class goes in root (next to main.lua).</p>
<p>If I make a class, Cow.lua, and save it in root (next to main.lua), then:</p>
<pre lang="Lua">Cow = {}
function Cow:new()
    local cow = {}
    return cow
end
return Cow</pre>
<p>Then anyone, including main.lua and others, can simply go:</p>
<pre lang="lua">require "Cow"
local myCow = Cow:new()</pre>
<p>If, however, you wish to use packages, then it matters where the file Cow.lua goes. If I used com.jessewarden.animals, then I&#8217;d:<br />
1. make a folder called &#8220;com&#8221;<br />
2. inside of &#8220;com&#8221;, make a folder called &#8220;jessewarden&#8221;<br />
3. inside of &#8220;jessewarden&#8221; make a folder called &#8220;animals&#8221;<br />
4. inside of &#8220;animals&#8221; put my Cow.lua</p>
<p>Then, whoever wants to use it goes:</p>
<pre lang="Lua">require "com.jessewarden.animals.Cow"
local myCow = Cow:new()</pre>
<p>Make sense?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: andrea		</title>
		<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243083</link>

		<dc:creator><![CDATA[andrea]]></dc:creator>
		<pubDate>Wed, 15 Feb 2012 18:40:41 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=2909#comment-243083</guid>

					<description><![CDATA[what goes where?
i have a file lua for the class and the main.lua... can you distinct where i need to put every portion of code?]]></description>
			<content:encoded><![CDATA[<p>what goes where?<br />
i have a file lua for the class and the main.lua&#8230; can you distinct where i need to put every portion of code?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: George		</title>
		<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243062</link>

		<dc:creator><![CDATA[George]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 14:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=2909#comment-243062</guid>

					<description><![CDATA[Thanks for the great article. I&#039;ve tried the meta table thing but I found it to be much work for... creating a table ... like you said. Giving your method a try ... I&#039;m a AS3 developer and I&#039;m used to working with object oriented languages and this &quot;Lua thing&quot; is very confusing to me. 
Thanks again for explaining everything... it saved me a lot of time. 
Bookmarked and Stumbled!]]></description>
			<content:encoded><![CDATA[<p>Thanks for the great article. I&#8217;ve tried the meta table thing but I found it to be much work for&#8230; creating a table &#8230; like you said. Giving your method a try &#8230; I&#8217;m a AS3 developer and I&#8217;m used to working with object oriented languages and this &#8220;Lua thing&#8221; is very confusing to me.<br />
Thanks again for explaining everything&#8230; it saved me a lot of time.<br />
Bookmarked and Stumbled!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JesterXL		</title>
		<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243054</link>

		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 19:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=2909#comment-243054</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243053&quot;&gt;Zach&lt;/a&gt;.

Thanks, glad it helps!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243053">Zach</a>.</p>
<p>Thanks, glad it helps!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Zach		</title>
		<link>https://jessewarden.com/2011/10/lua-classes-and-packages-in-corona.html/comment-page-1#comment-243053</link>

		<dc:creator><![CDATA[Zach]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 18:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=2909#comment-243053</guid>

					<description><![CDATA[Thanks for the great write ups!  Definitely making the transition into Corona a whole lot less painful.  I checked out your code for the top down Tyrian esque game as well.

I am working on a few general libraries that should hopefully make Corona development even less painful - a TouchManager for figure out how the playing is tapping, swiping, etc (multi touch as well) and also some ParticleEffect engine stuff.  While I wish Flash was viable (and still might be...) on mobile I am glad people like you are moving into the Corona community.]]></description>
			<content:encoded><![CDATA[<p>Thanks for the great write ups!  Definitely making the transition into Corona a whole lot less painful.  I checked out your code for the top down Tyrian esque game as well.</p>
<p>I am working on a few general libraries that should hopefully make Corona development even less painful &#8211; a TouchManager for figure out how the playing is tapping, swiping, etc (multi touch as well) and also some ParticleEffect engine stuff.  While I wish Flash was viable (and still might be&#8230;) on mobile I am glad people like you are moving into the Corona community.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
