b3agz [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=44626 Escape From Radtown <p><center><img style="margin-bottom:16px" border=0 src="/media/44626/showreel.png" alt="" /></center></p> <p>I'm posting this here because I'm not sure if it will get any more development, but this is a game I made for a 1-Bit weekend game jam (this one: <a href="https://itch.io/jam/1-bit-weekend">https://itch.io/jam/1-bit-weekend</a>). The game itself is &quot;complete&quot; in that there are no half-finished levels or artwork, it's just a little short due to the time constraints (it was a 3 day jam but work meant I only really had 2 days). Anyway, here it is. More info below if you're interested.</p> <p><center> <table><tr><td> <a href="/bbs/?pid=78393#p"> <img src="/bbs/thumbs/pico8_radtown0-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=78393#p"> Escape From Radtown</a><br><br> by <a href="/bbs/?uid=44626"> b3agz</a> <br><br><br> <a href="/bbs/?pid=78393#p"> [Click to Play]</a> </td></tr></table> </center></p> <p>The game and art was done entirely by me, and my partner in music projects put together some nice tunes (all the music was by him). You can find the Itch page here; <a href="https://b3agz.itch.io/escape-from-radtown">https://b3agz.itch.io/escape-from-radtown</a>. But to save you a click, here's the text from the page:</p> <p>Radtown is a radioactive mess. I mean, really; it's in the name. You want out, but the city's high walls and inexplicable moat of radioactive waste makes escaping a little tricky.</p> <p>But you have a special power.</p> <p>Using a mysterious mirror you can shift into the, uhm, Mirror World...ok I'mma level with you. This game was created for a 3 day game jam and the story does't make a whole lot of sense. Just go with it.</p> <p>The jam in question was Aspect Manufacture's 1 Bit Weekend, where the restriction was to create a game using only two colours (at one time) using at least one of the following themes;</p> <p>Radioactive<br /> Reflections<br /> Dragons<br /> So that's that. The controls are standard Pico controls (arrow keys and Z / X for actions), but there's a tutorial bit in the game. This was a lot of fun to make. It's not very long for obvious reasons, but I hope you enjoy it.</p> <p>And, for those what might be interested, I also streamed the first couple hours of the jam,</p> <p><center><object width="640" height="400"><param name="movie" value="https://www.youtube.com/v/7ewFwyvuaPg&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/7ewFwyvuaPg&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="400"></embed></object></center></p> https://www.lexaloffle.com/bbs/?tid=38522 https://www.lexaloffle.com/bbs/?tid=38522 Mon, 22 Jun 2020 14:39:07 UTC Colour Swapping In Sprites <p>What up fishes!</p> <p>So, I'm new to Pico (mostly a Unity/C# person) and I've been getting my bearings this last week. I was looking into ways to get more game content out of fewer sprites. The most obvious way seemed to be using the same sprites but changing the colour palette. I did some searching and found a few posts where this came up but the only answer I found was to use pal() which unless I'm missing something, changes the screen palette, which affects every instance of that colour onscreen.</p> <p>So, below is the solution I landed on. Is there a better way to do this? If so, pls halp.</p> <p>(I've changed some variable names for clarity, I don't normally label things 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>--Define a 2D array of colour indexes. C1 is the colour we're swapping, C2 is what we're --swapping it to. SecondarySpritePalette={ {c1=14,c2=11}, {c1=2,c2=3}, {c1=10,c2=1}, {c1=4,c2=5}, {c1=15,c2=4} } --Draw sprite on screen using custom sprite drawing function that takes in the above array. DrawSprite(SpriteID, XPos, YPos, PaletteArray) function DrawSprite(n, x, y, c) --Get position of sprite within the spritesheet. local ycell=(flr(n/16)) local xcell=(n-(16*ycell)) --Loop through each pixel in the sprite. for lx=0,7 do for ly=0,7 do --Get the current pixel colour. col=sget((xcell*8)+lx,(ycell*8)+ly) --Loop through each colour in the palette array for i in pairs(c) do --If the current pixel matches C1, swap it for C2 and break --out of this loop. if col==c[i].c1 then col=c[i].c2 break end end --Only draw the pixel to screen if it is not 0 (or whatever colour we --want to be transparent. if not(col==0)then pset(x+lx,y+ly,col) end end 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>The above code works (see below) but feels a bit... messy.</p> <img style="margin-bottom:16px" border=0 src="/media/44626/db5efde2-efc5-4a2d-9e4d-1adf905b1f80.jpg" alt="" /> https://www.lexaloffle.com/bbs/?tid=38109 https://www.lexaloffle.com/bbs/?tid=38109 Sun, 24 May 2020 13:34:02 UTC