peymanx [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=70430 paddle-x <p> <table><tr><td> <a href="/bbs/?pid=119259#p"> <img src="/bbs/thumbs/pico8_paddle_mario-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=119259#p"> paddle_mario</a><br><br> by <a href="/bbs/?uid=70430"> peymanx</a> <br><br><br> <a href="/bbs/?pid=119259#p"> [Click to Play]</a> </td></tr></table> </p> <p>Ok,<br /> This is my second game...<br /> Pico8 is reallllly fun</p> <img style="margin-bottom:16px" border=0 src="/media/70430/preview.gif" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/70430/pre2.gif" alt="" /> <h2>Source code at Github:</h2> <p><a href="https://github.com/peymanx/paddle_mario_game">https://github.com/peymanx/paddle_mario_game</a></p> <p>🤩 HAVE FUN</p> https://www.lexaloffle.com/bbs/?tid=49830 https://www.lexaloffle.com/bbs/?tid=49830 Tue, 18 Oct 2022 18:58:19 UTC Mario vs Khabis 🎮 <p> <table><tr><td> <a href="/bbs/?pid=119095#p"> <img src="/bbs/thumbs/pico8_mario_vs_khabis-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=119095#p"> mario_vs_khabis</a><br><br> by <a href="/bbs/?uid=70430"> peymanx</a> <br><br><br> <a href="/bbs/?pid=119095#p"> [Click to Play]</a> </td></tr></table> </p> <p>What's up guys<br /> I made a video to explain how Lua works - in Persian<br /> and this game is the result<br /> only in 20min you can make a wonderful game</p> <p>In Persian &quot;khabis&quot; means bad guy.<br /> Khabis and mario try to get fruits and avoid bombs.<br /> a simple senario and addictive game :)</p> <img style="margin-bottom:16px" border=0 src="/media/70430/mario_4.gif" alt="" /> <p>Collision Detection<br /> In physics, a collision is any event in which two or more bodies exert forces on each other in a relatively short time.</p> <img style="margin-bottom:16px" border=0 src="/media/70430/197976201-d06dd44c-55da-4f20-abf3-6ded6d210fdc.gif" alt="" /> <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>function collision(a,b,x,y) if (a &lt;= x and a+8 &gt;=x or x &lt;= a and x+8 &gt;=a) and (b &lt;= y and b+8 &gt;=y or y &lt;= b and y+8 &gt;=b) then return true end return false end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h1>Mario vs Khabis</h1> <p>This game is part of a tutorial</p> <p>Github source code:<br /> <a href="https://github.com/peymanx/Mario-vs-Khabis">https://github.com/peymanx/Mario-vs-Khabis</a></p> <img style="margin-bottom:16px" border=0 src="/media/70430/KHABIS.gif" alt="" /> <p><img src="https://user-images.githubusercontent.com/110537772/197327108-8d1ce770-048f-4ef8-9924-5a018626667b.png" alt="image" /></p> <img style="margin-bottom:16px" border=0 src="/media/70430/MARIO.gif" alt="" /> <p> <table><tr><td width=32> <img src="https://www.lexaloffle.com/bbs/gfxc/70430_0.png" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_70430_0"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/70430_0.txt", function (retdata){ var el = document.getElementById("gfxcode_70430_0"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_70430_0" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> vs <table><tr><td width=32> <img src="https://www.lexaloffle.com/bbs/gfxc/70430_1.png" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_70430_1"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/70430_1.txt", function (retdata){ var el = document.getElementById("gfxcode_70430_1"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_70430_1" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </p> https://www.lexaloffle.com/bbs/?tid=49786 https://www.lexaloffle.com/bbs/?tid=49786 Fri, 14 Oct 2022 12:30:32 UTC peyman-x puzzle hitter <p> <table><tr><td> <a href="/bbs/?pid=119089#p"> <img src="/bbs/thumbs/pico8_px_puzzle-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=119089#p"> peyman-x puzzle hitter</a><br><br> by <a href="/bbs/?uid=70430"> peymanx</a> <br><br><br> <a href="/bbs/?pid=119089#p"> [Click to Play]</a> </td></tr></table> </p> <p>First I load my image to a table,<br /> final positions in x,y and random position in (a,b)</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>function load_image() --load the image me = {} for j=0,8 do row={} for i=0,8 do add(row,{ spr=j*16+i, x=i*8+30, y=j*8+20, a=rnd(150), b=130, }) end add(me, row) end 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>then I call a magnet() function to move a=&gt;x and b=&gt;y</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>function magnet() local step=1 for j=1,8 do for i=1,8 do local p = me[j][i] x= p.a y= p.b if p.a &gt; p.x then p.a-=step end if p.a &lt; p.x then p.a+=step end if p.b &gt; p.y then p.b-=step end if p.b &lt; p.y then p.b+=step end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>Happy Coding</h2> https://www.lexaloffle.com/bbs/?tid=49785 https://www.lexaloffle.com/bbs/?tid=49785 Fri, 14 Oct 2022 09:11:05 UTC