sudoradish [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=15960 Changing the origin point <p>Is there a way of changing the origin point of a sprite/object to be central?</p> <p>in Love i would use getHeight()/2</p> https://www.lexaloffle.com/bbs/?tid=28453 https://www.lexaloffle.com/bbs/?tid=28453 Fri, 06 Jan 2017 08:59:09 UTC Animating Sprites. <p>I have been working on a little project aimed at teaching myself the LUA language one bit at a time.<br /> to this end I used the basic timer I developed to control 4 sprites animation. </p> <img style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/bbs/files/15960/PICO-8_1.gif" width=256 height=256 alt="" /> <p>I have also created a little hitbox around it so that it can be shot and the animation stop.</p> https://www.lexaloffle.com/bbs/?tid=28051 https://www.lexaloffle.com/bbs/?tid=28051 Sat, 12 Nov 2016 04:56:56 UTC Working on some sprites <p>I have been trying to work on a game using pure code. This, however, is causing more headaches than required. So I went back to making sprites lol. </p> <p>--Original Size</p> <img style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/bbs/files/15960/1.png" width=128 height=128 alt="" /> <p>--2x Size</p> <img style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/bbs/files/15960/Sprite-0002.png" width=256 height=256 alt="" /> https://www.lexaloffle.com/bbs/?tid=28034 https://www.lexaloffle.com/bbs/?tid=28034 Mon, 07 Nov 2016 09:59:14 UTC Chase logic <p> <table><tr><td> <a href="/bbs/?pid=31376#p"> <img src="/bbs/thumbs/pico31375.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=31376#p"> Chase logic</a><br><br> by <a href="/bbs/?uid=15960"> sudoradish</a> <br><br><br> <a href="/bbs/?pid=31376#p"> [Click to Play]</a> </td></tr></table> </p> <p>In more of a attempt to learn Pico 8 simply from the manual I have created a enemy that cases the player. </p> <p>There is nothing very exciting to this as it is a test of the logic. Essentially the enemy looks to see where the player x and y is. it then minuses or adds 1 to its own location depending on if it is &gt; or &lt; the target location on the x and y.</p> https://www.lexaloffle.com/bbs/?tid=27938 https://www.lexaloffle.com/bbs/?tid=27938 Fri, 21 Oct 2016 08:24:33 UTC A basic &quot;hit&quot; box <p> <table><tr><td> <a href="/bbs/?pid=31329#p"> <img src="/bbs/thumbs/pico31327.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=31329#p"> A basic &quot;hit&quot; box</a><br><br> by <a href="/bbs/?uid=15960"> sudoradish</a> <br><br><br> <a href="/bbs/?pid=31329#p"> [Click to Play]</a> </td></tr></table> </p> <p>Who says that smashing your head against a brick wall for a while doesn't yield results. </p> <p>So in my attempt to go teh old school I decided to see how well I could implement some hit detection. Using all code with hard coded images.</p> <p>First issue. The centre point is literal. </p> <p>Yeah this means that trying to keep the ball in play field will always result in some overhang. Which doesn't look good. </p> <p>Enter arrays!</p> <p>and the second issue. They are a twat to work with. In a good kind of way. </p> <p>I ended up making some markers to make a kind of hit point. Once this point goes past the screen bounds it keeps the ball in the field. </p> <p>as the markers leave the field it forces the middle of the ball to a neutral area in the field close to the edge. Giving the impression the ball is staying put.</p> <p>Anyway. Have a play and look at the code. I have tried to annotate as much as possible and left debugging info on the screen. </p> https://www.lexaloffle.com/bbs/?tid=27934 https://www.lexaloffle.com/bbs/?tid=27934 Thu, 20 Oct 2016 15:17:40 UTC Screen pixel paper <p>I got really annoyed with myself trying to visualize coordinates on the screen. So I used my l33t excel skills to throw a grid together with some reference numbers. </p> <img style="margin-bottom:16px" border=0 src="http://i.imgur.com/xv1t1q2h.jpg" alt="" /> <p>I am doing this bastard oldschool. </p> https://www.lexaloffle.com/bbs/?tid=27928 https://www.lexaloffle.com/bbs/?tid=27928 Thu, 20 Oct 2016 07:23:49 UTC Basic timer <p> <table><tr><td> <a href="/bbs/?pid=31220#p"> <img src="/bbs/thumbs/pico31219.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=31220#p"> Basic timer</a><br><br> by <a href="/bbs/?uid=15960"> sudoradish</a> <br><br><br> <a href="/bbs/?pid=31220#p"> [Click to Play]</a> </td></tr></table> </p> <p>Just a basic timer that I made to count seconds, minutes and hours. Plan on using it in a game to time special states. </p> https://www.lexaloffle.com/bbs/?tid=27920 https://www.lexaloffle.com/bbs/?tid=27920 Wed, 19 Oct 2016 08:21:12 UTC Really does feel like the old days <p>This really does feel like the old days. Where you would turn on a BBC Micro, C64 or MS-DOS computer and then get stuck in. </p> <p>When I saw the program does peeks and pokes I nearly wept. Out of nostalgic joy and flashbacks to getting the C64 to bloody do what I wanted it to lol. </p> <p>I love the little pixel editor. Reminds me of SEUCK in the way it works. And the Wave editor is like something I used on the Amiga. </p> <p>Bravo!</p> https://www.lexaloffle.com/bbs/?tid=27807 https://www.lexaloffle.com/bbs/?tid=27807 Tue, 04 Oct 2016 11:36:11 UTC Collision detection <p>Could be me been tired. But I don't get why my character is falling through the map.</p> <p>I thought I had done some basic collision detection, after following some tutorials. However it doesn't seem to work and my character simply falls straight through the map. </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> --player variables p1= { --initial sprite start --point and velocities x=64, y=24, vx=0, vy=0, isgrounded=false, grav=0.2, } function _update() --left and right movement p1.dx=0 if btn(0) then --left p1.dx=-2 end if btn(1) then --right p1.dx+=2 end p1.x+=p1.dx --gravity p1.vy+=p1.grav p1.y+=p1.vy local v=mget((p1.x+4)/8,(p1.y+8)/8) p1.isgrounded=false if p1.vy&gt;=0 then --look for a solid tile if fget(v,0) then --place p1 on top of tile p1.y = flr((p1.y)/8)*8 --halt velocity p1.dy = 0 --allow jumping again p1.isgrounded=true end end end function _draw() cls() map(0,0,0,0,128,128) spr(48,p1.x,p1.y) end </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=27803 https://www.lexaloffle.com/bbs/?tid=27803 Tue, 04 Oct 2016 08:42:39 UTC Crashing when switching screen modes <p>Hi</p> <p>Just bought Pico 8 today. Really impressed with it and reminds me of the days I would code on my C64. </p> <p>However when I switch from full screen it crashes. Not reason given. Just a crash message. </p> <p>I am running Windows 10. </p> https://www.lexaloffle.com/bbs/?tid=27794 https://www.lexaloffle.com/bbs/?tid=27794 Mon, 03 Oct 2016 13:19:42 UTC