HunaJive [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=21799 Path editor <p> <table><tr><td> <a href="/bbs/?pid=37219#p"> <img src="/bbs/thumbs/pico37218.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=37219#p"> Path editor .5</a><br><br> by <a href="/bbs/?uid=21799"> HunaJive</a> <br><br><br> <a href="/bbs/?pid=37219#p"> [Click to Play]</a> </td></tr></table> </p> <p>A small cart I've made to make my scroll shooter game development easier.</p> <p>It's a pretty custom editor, and it's definitely not finished, but you might find it useful if you want to write your own editor.</p> <p>If you have a good idea about improving this, please, post it down here.</p> https://www.lexaloffle.com/bbs/?tid=28797 https://www.lexaloffle.com/bbs/?tid=28797 Mon, 06 Feb 2017 11:46:29 UTC How to address table from function within it <p>I have lots of different tables for different things.<br /> Adding functions into these tables looks like a good idea, because I can write every update or draw for every type of enemy the same way. Something like this:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> for e in all(enemies) do e.update() end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The only thing I want to know, is how can I address the table within it's function?<br /> For example:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> enemy = { x=0,y=0, update = function() [b]--how to address these x and y variables from this update function?[/b] x+=1 y+=1 end } </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Writing something like <em>e.update(e)</em> seems stupid. Maybe what I'm talking about isn't even possible, I just couldn't find anything on this subject.<br /> Thanks for any help</p> https://www.lexaloffle.com/bbs/?tid=28772 https://www.lexaloffle.com/bbs/?tid=28772 Wed, 01 Feb 2017 16:53:24 UTC