EDIT: updated demo to include huge optimizations contributed by Felice and ultrabrite in the thread below.
After reading this fascinating article about the Minsky Circle, I started experimenting with the algorithm in Pico-8. In the process, I stumbled upon a method for rasterizing circles that seems to be faster than the native circ() and circfill() functions at larger sizes, and also has a more pleasing look that minimizes low-resolution aliasing.
Demo attached in case anyone finds this useful. Press Z (or whatever key you've bound to button 1) to toggle between the Minsky Circle-based methods and the native Pico-8 draw functions.
--by @musurca and @Felice function minskycirc(x,y,r,c) x,y=x+0.5,y+0.5 local j,k,rat=r,0,1/r poke(0x5f25,c) --set color for i=1,0.785*r do k-=rat*j j+=rat*k pset(x+j,y+k) pset(x+j,y-k) pset(x-j,y+k) pset(x-j,y-k) pset(x+k,y+j) pset(x+k,y-j) pset(x-k,y+j) pset(x-k,y-j) end pset(x,y-r) pset(x,y+r) pset(x-r,y) pset(x+r,y) end -- @musurca, @Felice, and @ultrabrite function minskycircfill(x,y,r,c) x,y=x+0.5,y+0.5 local j,k,rat=r,0,1/r poke(0x5f25,c) --set color for i=1,r*0.786 do k-=rat*j j+=rat*k rectfill(x+j,y+k,x+j,y-k) rectfill(x-j,y+k,x-j,y-k) rectfill(x-k,y-j,x-k,y+j) rectfill(x+k,y-j,x+k,y+j) end rectfill(x,y-r,x,y+r) end |





I'm new to Pico-8 and this is my first snippet. I would appreciate any feedback, or ways of making this more efficient.
It's a snippet to draw a sprite in an area as a repeating pattern texture.
function drawpattern(idx, x0, y0, x1, y1) local sprx = 8 * (idx % 16) local spry = 8 * flr(idx/16) for y=y0,y1,8 do local endy = min(y1, y+8) local sampleh = endy-y for x=x0,x1,8 do local endx = min(x1, x+8) local samplew = endx-x sspr(sprx, spry, samplew, sampleh, x, y, samplew, sampleh) end end end |
Update to fix issue with save data.
This is my first game ever. Is it the greatest game you've ever seen? That depends on whether or not you've seen another game.
Here are some things critics are saying about games:
"...has all the things the original video game did not..." - NY Daily Times
"...the opening sequence is Halo-level epic..." - trustedreview.com
"...a polished, well-designed RPG, and through its phenomenal mechanics, astounding art, sound design and fantastic writing, it is sure to revolutionize the modern RPG genre." - Windows Central
"...For the first time ever, I truly felt like I was in space..." - COGConnected
I don't think I've missed it anywhere, checked the values on the appropriate (and all other) stat values, etc. There doesn't seem to be a way to get the mouse wheel. This'd be awfully useful in a tool I'm writing. I'm bummed that I have to turn to the dpad/cursor keys while otherwise mousing around in my little gui.
@zep - Assuming I'm not just missing it, would you mind adding the mouse wheel as another stat? Just treat it like an axis; that seems to work better than blipping buttons, in my experience with other APIs. Just increase or decrease the stat value by one each time you get the scroll event.
Please and thanks? :)





This cartridge is just a solution of a problem from an algorithm course. It's not made to be reused!
But do what you want with it ;-)
How to use:
- first state is step by step generation, press btn_5 (<x> on keyboard) for next step or btn_4 (<z>) for automatic generation
- second state is auto generation, press btn_5 to speed it up (+20%), or btn_4 for generating all at once
- when the maze is generated (green pixel at bottom right corner), press btn_5 for show/hide path to the exit, move with the arrows keys or press btn_4 to restart from the begining


For @morningtoast
EDIT: This is a quick example of how to pack data (here, tables) inside of cart memory instead of the code editor, and then load it from there during runtime. To that you can reduce the compressed code size of your cart.
It's not really proper compression, though. If you want to see that, check out this instead: https://www.lexaloffle.com/bbs/?tid=3930





Done in about an evening as a first project using the system, I'm actually quite surprised it turned out decent looking for a first go from scratch thing, for both visual stuff and physics.
Pretty basic functionality, Left, right and up arrow keys nudge the ball, z toggles the trail on and off.
Feel free to pick it apart for your own usage.
I notice the Pico-8 font has some semi-graphical characters, but not quiite enough to make a real retro text-mode UI out of.
I'd love to see some of the old DOS box-drawing characters added to the pico font if there's space for a few more glyphs.





I'm sorry, but I have to say, I personally don't like these posts lately with obfuscated code driving people to Patreon to pay for the useful-to-learn-from code. Feels very counter to the spirit of Pico-8.
I think I'm going to stop commenting on any post that has obfuscated code with the real code behind a paywall. It's easy enough to click the Code button and see immediately whether or not it's obfuscated. I don't want to encourage the practice by bumping what are basically ads for a person's Patreon to the top.
I don't mind people encouraging Patreon donations, mind you, but when they're dangling the original code as a carrot for their Patreon, that's what feels counter to the spirit.
Yes, it's kind of a weak stand to take, since I'm not everyone's cup of tea anyway and my comments may not have been welcome in the first place, but it's all I've got. :)
Edit: Quoting my post from below:
[i]By the way, I want to be clear about something:
I'm not calling for rules against doing this, or for zep to do something about it. I'm saying I don't









