DemiMakesGames [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=79590 Pong! 1.0 <p> <table><tr><td> <a href="/bbs/?pid=132206#p"> <img src="/bbs/thumbs/pico8_pongem-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132206#p"> Pong! 1.0</a><br><br> by <a href="/bbs/?uid=79590"> DemiMakesGames</a> <br><br><br> <a href="/bbs/?pid=132206#p"> [Click to Play]</a> </td></tr></table> </p> <h1>PONG!</h1> <h2>The classic game for the Atari, horribly remade!</h2> <h3>Description:</h3> <p>This cartridge is a poorly done remake of the game &quot;Pong&quot; for the Atari!<br /> Although it's different because the original Atari Pong didn't have an exclamation<br /> mark in it's name, here's a visualization for that:</p> <p><em>Pong (1972)</em> &lt;- Not cool, does not have an exclamation mark after it's name</p> <p><em>Pong! (2023)</em> &lt;- Very cool, has exclamation mark after it's name</p> <p>Anyways, this game uses my color collision system, which means that it doesn't have very smooth collision, although trust me it's playable, there's just gonna be some bugs that I haven't figured out yet. It also means that this isn't pure black and white, which would have been preferable. Luckily, I may update this soon and fix bugs, revamp the collision, and add anything else that would enhance the experience of-</p> <h1>PONG!</h1> <p>&lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm;&lrm;&lrm; &lrm; &lrm; &lrm; &lrm; &lrm;&lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; ^<br /> &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm;&lrm;&lrm; &lrm; &lrm; &lrm; &lrm; &lrm;&lrm; &lrm; &lrm; &lrm; &lrm; &lrm; &lrm; ||<br /> &lrm; &lrm; &lrm; &lrm; &lrm;&lrm;Now THATS one hell of an exclamation mark!</p> <h3>Controls:</h3> <p><strong>Game:</strong></p> <p><em>Player 1:</em></p> <ul> <li>Up: Up</li> <li>Down: Down</li> </ul> <p><em>Player 2:</em></p> <ul> <li>Up: X</li> <li>Down: O</li> </ul> https://www.lexaloffle.com/bbs/?tid=53490 https://www.lexaloffle.com/bbs/?tid=53490 Fri, 21 Jul 2023 19:24:15 UTC Movement and Collision Demo 1 <p> <table><tr><td> <a href="/bbs/?pid=132160#p"> <img src="/bbs/thumbs/pico8_movandcoldemo1-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132160#p"> Movement and Collision Demo 1</a><br><br> by <a href="/bbs/?uid=79590"> DemiMakesGames</a> <br><br><br> <a href="/bbs/?pid=132160#p"> [Click to Play]</a> </td></tr></table> </p> <h2>This system is not my own original work</h2> <h3>Tis a tweak of a tutorial's system</h3> <hr /> <p>Following a tutorial by/on <strong>NerdyTeachers.com</strong>, I was able to whip up this simple collision demo with flag collision, camera collision, movement, and a <em>terrible</em> &quot;music&quot; track.</p> <hr /> <p>The tutorial link(s) are below for anyone interested!</p> <p><object width="640" height="400"><param name="movie" value="https://www.youtube.com/v/hejwsu9A9g&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://www.youtube.com/v/hejwsu9A9g&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="400"></embed></object></p> <p><a href="https://nerdyteachers.com/Explain/Platformer/">https://nerdyteachers.com/Explain/Platformer/</a></p> <hr /> <p>Collision system:</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 colcheck(plr,flag,aim) -- player is a table -- player must have x,y in it's table -- flag must be an integer, in our case &quot;0&quot; symbolizes a solid wall -- aim: 0=left,1=right,2=up,3=down -- I don't need width or height in my player table because I know (in my case) it will always be 8 on both sides if pl.iscol==false then -- if the player can't collide, then return &quot;false&quot; return false -- In our case, true = yes, there is something blocking you from moving in that direction -- whereas false = no, there is nothing in that direction end local x=plr.x local y=plr.y -- Make referring to the current x/y simple local x1=0 local x2=0 -- Declare our x1/x2/y1/y2 variables for further modification local y1=0 local y2=0 if aim == 0 then -- What we do here is create a 1 pixel wide and imaginary rectangle using 2 coordinates so we can -- check for collisions, we then use our already defined 2 coords. to find the other coordinates -- in the rectangle to form it completely. This is pretty complicated to be explained in text, -- so I recommend you watch, read the tutorial for a visual explanation! x1=x x2=x-1 y1=y y2=y+7 elseif aim == 1 then x1=x+7 x2=x+8 y1=y y2=y+7 elseif aim == 2 then x1=x x2=x+7 y1=y y2=y-1 elseif aim == 3 then x1=x x2=x+7 y1=y+7 y2=y+8 end x1/=8 x2/=8 y1/=8 y2/=8 -- Divide our imaginary box coordinates by 8, for tile conversion if fget(mget(x1,y1),flag) -- Check if any of our coordinates have a sprite on the same tile coord. or fget(mget(x2,y2),flag) -- &quot;Or&quot; for simplicity, if ANY of our values are colliding we return true or fget(mget(x2,y1),flag) or fget(mget(x1,y2),flag) then return true -- Yep, we found a collision else -- If we haven't found a collision, then return false -- Nope, you are good to move further end -- End our check end -- End the function</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=53478 https://www.lexaloffle.com/bbs/?tid=53478 Thu, 20 Jul 2023 15:38:18 UTC