Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General :: [Thread List]

Cart #zusonukofi-0 | 2020-07-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Hello there this is my first project in Pico-8. I always thought it would be fun to attempt to make a simple calculator for myself. the '=' button performs clear screen operations for now though maybe I can update it later with a proper dedicated button. anyway I hope you all like my little project!

P#78965 2020-07-06 02:23

I was testing out various PICO-8 cartridges in the new version, including my own Rain Gif cart, and I discovered that when I chose the built-in "Save Gif" option, it would report that a GIF was saved to the desktop:

...but no file would appear.

On further testing, I discovered that on manually saving an image, it throws an error:

I'm not sure why this would happen - I've already checked whitelisting PICO-8 in my virus checker and that changes nothing. (And besides, I can save files and use the audio exporter just fine.) I'm running Windows 7 (yes, I know...) and installed PICO-8 yesterday using the installer download.

P#78963 2020-07-06 01:31

I'm loving PICO-8 with one exception: I'm not crazy about Lua. I've read the Lua documentation for OOP, but the table thing is so different and I can't find examples for what I'm trying to do.

I'm almost finished something I'm working on, but the larger the program gets the more I miss being able to separate the logic into objects (the way I'm used to anyway).

Long story short, I wanted to do the following:

Entity Class:

  • x, y, width, height, speed, etc
  • function update()
  • function draw()

Player Class(that inherits from the entity class):

  • score, weapon, power, etc
  • function update(overrides but calls super function from entity)
  • function draw(same)

Enemy Class(that inherits from the entity class):

  • extra variables
  • overridden functions calling super functions Entity class

SpecialEnemy Class(that inherits from Enemy/and then from Entity obviously)

  • extra variables
  • overridden functions calling super functions from Enemy class

I hope that makes sense. It looks like Lua doesn't really have a natural way to do multiple inheritance. Anyway, does anyone have any tips for how to implement something like this? Right now, I everything is just procedural.


P#78962 2020-07-06 00:14

In my qsort() thread:


If you click the "Code" button on the embedded cart and scroll down to qsort() or iqsort(), you'll see a line near the top of each function that says, if l then, but the line inside the cart is actually if l<r then, so if anyone grabs the code for the function, they get a corrupted version of it.

I'm guessing this, and possibly other, reserved HTML elements are not being escaped properly...?

P#78960 2020-07-05 23:31 ( Edited 2020-07-05 23:35)

Cart #necromancers_tower-1 | 2020-07-05 | Code ▽ | Embed ▽ | No License

Hi all, I'm working on a single-screen platformer in the vein of Bubble Bobble and Snow Bros., but with a lite-rpg twist. Let me know what you think! Only 8 levels now but there will be at least 16 in the final.

P#78948 2020-07-05 21:25

This is perhaps a bit off topic, or maybe not.

I just deployed a rough, first version of an online pixelart drawing app: https://pixla.nu/?ps=DyIAIQESCSIBIIICIRILIoEgAg8iACENIgACNiIBAAACCyIAIAF3AHALIgAHAncAAgoihAcAcAcCCiKEBwBwBwIKIgAHAncAAgoihAdwAHcCCiKDIHAAcAsigyB4gHALIgAHAXcAcAUiBBEAEAJ3AHALEQIAAAF_EUUR

It's meant to be limited in features, a little bit like pico-8 actually. The canvas size is fixed to 32x32, and the palette is fixed to the (original) pico-8 palette. Left button draws, right button picks up the color under the mouse.

Perhaps the most special thing is that the pixels are saved in the URL, so the images can be saved by simply bookmarking the page. The links are also easily shared on social media, and the preview includes the image.

If it's not clear from the screenshot, I can't draw. So I hope some people with some pixel art skills will find the tool fun and useful. Please try it out, and let me know of any problems or feature requests you might have!

Oh, the name of the site is in swedish. "Pixla nu" means "Draw pixels, now!", where pixla is the verb form of pixel and nu means now.

P#78929 2020-07-05 11:23 ( Edited 2020-07-05 11:46)

Bolygone Explorer

Cart #bolygoneexplorer-0 | 2020-07-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA



Learning Pico8 here is my first cardridge.

Idea comes from an old book about computer & graphics : Graphisme Scientifique sur Micro Ordinateur by Robert DONY (1986)

P#78923 2020-07-05 07:48 ( Edited 2020-07-05 07:56)

Hi all,

In preparation for an upcoming game jam, I've quickly recreated Cannonhead Clash, an Atari 2600 homebrew game that I first published almost a year ago. This version has quite a bit missing (no menus, no AI opponent, etc) but I hope you enjoy it regardless.

This game is a two player game where you try to hit the opponent with one of your bombs. By holding down either button, you charge your shot- the longer the charge, the further the bomb goes. Your bombs can destroy terrain, too, so keep that in mind!

Cart #yenatmusi-1 | 2020-07-05 | Code ▽ | Embed ▽ | No License

If you'd like to see the original 2600 version you can find it here.

Version 2.0:

  • Added title screen
  • Added CPU opponent
  • Added scoring
  • Fixed infinite charging bug for Player 2
  • Fixed bug where walk sound/animation would not play if left/right was held during the death animation
P#78911 2020-07-04 22:38 ( Edited 2020-07-05 17:45)

Cart #palmixwave01-1 | 2020-07-04 | Code ▽ | Embed ▽ | No License

Palmix Wave Ver0.1

Invaders from the Pamix system are attacking the Earth! Clear the menace aboard the Space Fighter!

Palmix Wave is a vertical shmup with a set play time of 2 minutes (A la caravan game mode). In the game you will encounter many types of enemies included a miniboss and a final boss. You will also find powerups that will make the space ship faster and shoot more bullets. These powerups will also give you a brief invencibility time.

This is also like my formally first try (like no sfx or music) of a completed game in Pico8. I began with a shmup tutorial but in midway I wanted to try the ECS game programming pattern. With a quick search this ECS Pico8 ECS engine came up https://www.lexaloffle.com/bbs/?tid=30039. After a few tries I finally got the pattern and I liked it very much (code is not that pretty). Hope you like it!

P#78910 2020-07-04 22:17

A while back I posted an implementation of an in-place dual-pivot quicksort, which is the default sort algorithm most standard libraries offer these days. I've since tweaked it a bit to save a few tokens, and today I wrote up a sample cart that does some primitive testing as an example of usage.

This includes both a general 221-token qsort(), which can accept a custom comparator function (defaults to a less-than comparator for ascending order), and a tweaked 199-token iqsort(), which inlines the comparisons as simple "<" operators, producing a smaller and faster sort in return for the sort order and index not being customizable.

See tab 0's header comment for more details.

(Side note: I realized while implementing comparators that you could sneak in shuffle functionality just by sorting with a random coin-flip comparator. Handy.)

Edit: WARNING! Do NOT grab the function from the "Code" flyout on the embedded cart below! There is a bug on the BBS right now that deletes a "<" comparison! Click the "Cart" button to download the .p8.png version!

Cart #putikutuke-0 | 2020-07-04 | Code ▽ | Embed ▽ | No License

Feel free to use it in any way you wish. I didn't invent the algorithm, and the implementation was inspired by looking at several other people's implementations (which in turn were inspired by other people's implementations, and so on). I'm not going to claim any original work here. I just did some grunt work tidying it up and applying ducktape where needed.

Please let me know ASAP if you find any bug. I think it's solid, but I know I'm not perfect.

P#78903 2020-07-04 19:20 ( Edited 2020-07-05 22:51)

Cart #axnjaxn_ajml-2 | 2020-07-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I couldn't resist making a cursed PICO-8 cart after someone sent me the What's Your Alex Jones Conspiracy Theory post on reddit by /u/dreggmuffin.

Given the subject matter "mad libs" is almost a double entendre.

(Press z/O button or x/X button to get a new conspiracy theory that you'll use to exploit the patriotism of your listeners!)

P#78900 2020-07-04 18:48 ( Edited 2020-07-04 18:52)

Cart #pullfrog-2 | 2020-07-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Play on Itch

Cactus blocks are falling for some reason. You, a little frog named frog, have to jump and dodge out of their way. Set them up in lines in order to clear them off of your land.

-Pull them with your tongue while they're green and falling.

-Turn them into dust once they're dry, yellow, and set on the ground.

Just be careful using that tongue of yours. Getting squished is easier than you think.

-Raise your acrobatics game by upgrading your jump height and tongue length every time you clear 3 lines.

-Collect all the eyes and uncover the mystery.

-But most of all we hope you have fun!

Pullfrog is a game created by Joven Paul and Mario Carballo. Made in Pico8 over the month of June 2020. We had a ton of fun making it and we learned a lot. If you have any feedback about it, feel free to let us know! We want to balance it just right so all kinds of players can enjoy it.

-Thanks for playing

P#78775 2020-07-04 16:59 ( Edited 2020-07-05 20:01)

On 0.2.1, trying to INSTALL_GAMES with 0.2.1 gives me this error.

INSTALL_DEMOS seems to work fine, though.

Might this be connected to the 0.2.1 release notes saying:
"Fixed: Crash when INSTALL_GAMES / INSTALL_DEMOS without a writeable disk"?

Platform: macOS Catalina, 10.15.5

P#78894 2020-07-04 12:48 ( Edited 2020-07-04 12:50)

I'm working on a big project for PICO8.

Around the end of 2018, I learned about the scalability of multi-carting and continued to research and create it to this day.

We were able to give each of the four carts a role, rather than just being a data bank .

Cart 1: Title/Ending/3D dungeon scene
Cart 2: Platformer Scene
Cart 3: Cooking Scene
Cart 4: World Map Scene/Important Item Riddle Solving Operation

Because of these many factors, an hour or more of play is a must.
Data saves are automatic.
(Position when resume, growth and LIFE, possessions, time, status of NPCs helped, farmland, important items, roots, history of roots removed, history of enemies removed, and other things for cart-to-cart interaction).

Most of the game system is complete. I'm currently assembling the map for the later areas.

If anyone is planning an original, reasonably large game, PICO8 will be used as a prototype. It looks like they will progress the production and do the actual product in another game engine. I've seen some of those opinions. (Not my project.)

So sometimes what I do seems like a waste of time or laziness in choosing a development environment.
I don't see a lot of things planned in PICO8 from start to finish. It's not much.
Is it because of the scarcity that I am still developing? I don't think that's the only reason.

I'm not great at asking questions and such. Still, I've been able to implement a lot of features in the game because people before me have been posting and discussing their work repeatedly. Thanks for leaving the information, very grateful to you.

(I think the English translation is unnatural because it is a long sentence.)


P#78871 2020-07-04 07:18

Hey, I decided to make a batch script to automate compiling PICO-8 cartridges into .p8.png, binary, and HTML. Instructions are in the batch file and there's an example using Celeste included.


P#78874 2020-07-04 05:51 ( Edited 2020-07-04 05:53)

Cart #danewumubu-0 | 2020-07-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

As of 0.2.1, mouse handling does not seem to work in HTML exports, though touch controls (and emulated touch controls with chrome dev tools) seem to be working.. It's fine in pico-8 and bin exports though, and in the BBS.

P#78870 2020-07-04 03:59

Cart #bururhopi-0 | 2020-07-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

This is a simple typewriter style text box, like we see in many RPGs and Adventure games.

I was looking for examples of text boxes like these and only found complex and robust examples. They are excellent! But I thought it would be useful to have a simpler more "noob friendly" system.

The code is very commented, so anyone should be able to follow along and understand what it is doing. Also, this system is very simple but versatile. It can easily be expanded or customized if you know what you are doing.

P#78868 2020-07-04 03:11

After updating to 0.2.1, exports of my cart are failing to load. I've deleted just about everything from it to make a minimal reproduction here, but I have no idea what is going on.

For both HTML and bin exports, the pico-8 splash appears, and it hangs after "booting cartridge"

In the included cart, both the comment at the bottom and the init method are required. Deleting the init method, or any more from the comment will allow the cart to load. O_o

Cart #bizehapowe-0 | 2020-07-04 | Code ▽ | Embed ▽ | No License

P#78869 2020-07-04 03:05 ( Edited 2020-07-04 03:10)

Hi All! PICO-8 0.2.1b is now up on lexaloffle, Humble, itch.io, and for PocketCHIP. This update started as a continuation of 0.2.0 bug-fixing work, but I also relaxed my position on API minimalism just enough to add some new features :D

UPDATE: 0.2.1b is now live and fixes the print() bug, and a few other things. See the changelog below for details.


You can draw ovals (technically, ellipses) both when running a cartridge, and when using the shape tools in the graphics/map editors. Ovals are specified by their boundary rectangle, and follow the usual draw state rules.


function _draw()
 for i=0,31/32,1/32 do
  local x=64+cos(i+t()/8)*48
  local y=64+sin(i+t()/8)*44
  local w=8+cos(i*2+t()/2)*6
  local h=8+sin(i*3+t()/2)*6


 print("pico-8 0.2.1",40,62,13)

Serial I/O

To make it easier to set up workflows for getting data in and out of carts during development, some new serial() channels are available. You can turn a file on your host machine into a binary stream, or drag and drop it into the running cartridge to do the same. From the manual:

Additional channels are available for bytestreams to and from the host operating system.
These are intended to be most useful for UNIX-like environments while developing toolchains,
and are not available while running a BBS or exported cart. Maximum transfer rate in all 
cases is 64k/sec (blocks cpu).

        0x800    dropped file   //  stat(120) returns TRUE when data available
        0x802    dropped image  //  stat(121) returns TRUE when data available
        0x804    stdin
        0x805    stdout
        0x806    file specifed with: pico8 -i filename
        0x807    file specifed with: pico8 -o filename

Image files dropped into PICO-8 show up on channel 0x802 as a bytestream:
The first 4 bytes are the image's width and height (2 bytes each little-endian, like PEEK2),
followed by the image in reading order, one byte per pixel, colour-fitted to the display 
palette at the time the file was dropped.

Drag and Drop

On a related note, you can also now drop .p8.png cartridges into PICO-8 to open them. If there is a cartridge with unsaved changes, it will prompt before continuing. You can also drop .png files into the spritesheet, by first selecting the sprite that should be the top-left corner location.

API Changes

add() now comes with an optional 3rd parameter: an integer that specifies the location in the table that the new value should be inserted at. Similarly, a new variation of del() is available: deli(tbl, index) ("delete by index") allows deleting from a given location in the table rather than by value.

split() is also new. It complements the common strategy of storing data as strings. From the manual:

split str [separator] [convert_numbers] 

Split a string into a table of elements delimited by the given separator (defaults to ",").
When convert_numbers is true, numerical tokens are stored as numbers (defaults to true).
Empty elements are stored as empty strings.

split("1,2,3")               -- returns {1,2,3}
split("one:two:3",":",false) -- returns {"one","two","3"}
split("1,,2,")               -- returns {1,"",2,""}

Binary Storage

It is now also more efficient to store 8-bit binary data in the source code section, by encoding it as a binary string. The .p8.png format stores uncompressable sequences as a raw block of data, effectively allowing cart authors to choose how much of the code section to trade for raw binary storage.

Binary strings can be encoded by escaping characters that can't appear in the source code. For example:
0 should become "\000" (or "\0" when not followed by another number), etc. To make this easier, previously invisible characters C1..C15 have font entries, and also unicode replacements when copying and pasting. I'm working on a snippet for converting between data strings and raw binary data, to make this process easier. UPDATE: here's the snippet.

HTML Touch Support under iOS

Touch controls for HTML exports is now a little smoother, and works when running from inside an iFrame (including itch.io game pages). I removed the mobile buttons menu by default (the buttons along the top: fullscreen, sound, close) as they aren't very useful and are messy, but they can be turned back on in the options near the top of the exported html.

Changelog // added 0.2.1b

There are many other bug fixes in this update, but I haven't gotten around to replying to the BBS threads yet. For now, please check the complete changelog:


Added: split(str,"") splits by single characters
Updated: Tower of Archeos 1.1 via INSTALL GAMES
Fixed: print(num,x,y) always prints numbers num in hexidecimal
Fixed: .p8.png decoder can enter an infinite loop (caused exports to freeze on boot)
Fixed: Can't save screenshot/gif when running a BBS cart with illegal characters in title.
Fixed: INSTALL_GAMES is broken
Fixed: Mouse is broken in HTML exports


Added: oval() ovalfill() split()
Added: circle drawing tool is now an oval tool (hold shift for circle)
Added: hold shift with line tool to snap to 22.5 degree angles from origin (0:1, 1:1, 2:1 gradients)
Added: serial() channels for stdin,stdout
Added: raw binary and image files dropped in to PICO-8 also become byte streams readable w/ serial()
Added: add(tbl, val, index) -- insert val into table at index
Added: deli(tbl, index) -- delete element from table by index (index defaults to last element)
Added: show progress while exporting binaries (can be slow now that generating zip files)
Added: -e to add an extra file to exported binaries zip files // export -e manual.txt foo.bin
Added: RESET command to reset the runtime / draw state
Added: drag and drop cartridges into PICO-8 window to load them
Added: hash stored in .p8.png so that cartridges corrupted by image quantization can show a specific error
Added: raw data blocks in compressed code format (useful for storing long binary strings efficiently)
Added: clip(x,y,w,h,true): 5th parameter indicates that the clipping region should be clipped by the old one
Added: -export switch can be used to convert .p8 files to .p8.png from commandline. // pico8 foo.p8 -export foo.p8.png
Added: extcmd("screen",scale) and extcmd("video",scale) to override the default scale (e.g. scale 2 means 256x256)
Added: printh(str, filename, overwrite, save_to_desktop) -- 4th parameter to save output file to desktop
Changed: add(), del() no longer implemented with Lua snippet; lower cpu cost.
Changed: line(),rect() cost the same as rectfill() when drawing equivalent shapes
Changed: all drawing operations in sprite editor now observe fill pattern state
Changed: numbers can be immediately followed by identifiers (a=1b=2) // lexaloffle.com/bbs/?tid=38038
Changed: Sprite editor shows only active area after shift-selecting sprites
Changed: copy/paste in the code editor treats uppercase ascii characters as puny font only when puny mode (ctrl+p) enabled
Changed: C0 Controls characters (except for 0x0,0x9,0xa,0xd) encoded in .p8 / clipboard with unicode replacements
Changed: stat(4) converts characters to PICO-8 format (P -> puny p, hiragana unicode -> single character etc.)
Changed: serial() returns number of bytes processed (1/8ths included for partial bytes)
Changed: IMPORT SPRITESHEET.PNG now uses the current sprite as the destination coordinate instead of 0,0.
Changed: Standardized name of the display palette to "display palette" (was sometimes referred to as "screen palette").
Changed: tostr() returns nil (used to return "[nil]")
Changed: don't need to set bit 0x40 at address 0x5f2c to use secondary palette.
Improved: exported binary's data.pod file 90% smaller (~870k -> ~85k)
Fixed: pack(...).n is shifted right 16 bits
Fixed: ctrl-r doesn't reload external changes for carts which are over compressed code capacity
Fixed: false positives when detecting external changes for some older cart versions
Fixed: .p8.png carts saved with dense code (compressed size > raw size, including very small carts) stores junk
Fixed: error message duplication when loading future version of .p8.png carts
Fixed: Illegal colours can enter spritesheet via serach-replace after setting with color()
Fixed: Preprocessor: "foo():a().x+=1" "a=b[1]c+=1"
Fixed: hex numbers written with punyfont characters breaks syntax high-lighting
Fixed: shift+- in sprite editor jumps too vertically when zoomed in
Fixed: clicking a note in sfx editor creates a selection (-> backspace clears without moving rows)
Fixed: print()/printh()/stop() doesn't respect __tostring metatable method (regression)
Fixed: time() and btnp() speed changes after stopping program, typing a command and then resuming.
Fixed: phantom drag & drop events sent to unused music channels causing them to occasionally unmute themselves
Fixed: undo after moving sprites in map mode only undoes the changes to the map and not the spritesheet.
Fixed: inconsistent token counting for negative or bnot'ed numbers https://www.lexaloffle.com/bbs/?tid=38344
Fixed: Crash when INSTALL_GAMES / INSTALL_DEMOS without a writeable disk
Fixed: stat(4) (clipboard contents) does not convert unicode to corresponding glyphs
Fixed: (MacOS) Using discrete GPU ~ drains battery. Now using integrated GPU when available.
Fixed: screensaver is blocked while PICO-8 is running (needed to set SDL_HINT_VIDEO_ALLOW_SCREENSAVER: "1")
Fixed: screen glitches after running for 25 days
Fixed: (HTML Exports) touch controls not registering when running under iOS from an iframe (e.g. on an itch.io page)
Fixed: (HTML Exports) tap and hold brings up the select menu under iOS
Fixed: (HTML Exports) button blocked by canvas when overlapping on small screens

P#78861 2020-07-04 00:59 ( Edited 2020-07-05 21:37)

In the web player here on the BBS which currently says it's version 0.2.1, it appears print() now displays numbers as hex:

EDIT: oh wow I didn't realize v0.2.1 was out for real and not just in the BBS web version; I downloaded it and tried running the same cart (#xmasfish) and figured out how to reproduce it so I have corrected the title and description since my first report wrongly said the issue was with tostr()

as you can see here, it only displays as hex when x,y arguments are given to print():

P#78864 2020-07-04 00:17 ( Edited 2020-07-04 00:45)
View Older Posts
Follow Lexaloffle:        
Generated 2020-07-06 02:31 | 0.145s | 4194k | Q:164