Log In  
Follow
oakreef
SHOW MORE

Cart #font_mapper-4 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Here's a cart I threw together for myself to use with the new custom font feature.

When run it will read the spritesheet into memory as a custom font, then copy a code snippet to your clipboard that will import that font into another cart. It doesn't include the values from 0x5f60->0x5f64, that define the overall font attributes. Those must be set manually in the cart you are importing to.

The import has several optimisations. Instead of always copying the entire custom font memory block it starts from the first non-zero memory value in the block and continue to the last. To save characters it will construct two exports: one that uses poke and one that uses poke4 and export whichever is smaller. It will leave out unnecessary zeroes and also trim leading and trailing zeroes in the hex values for the poke4 export. It also stores all the values as a big string that's split and unpacked at runtime to save tokens.

When defining the custom font on the spritesheet each 8x8 tile is one character and any non-zero colour value in the sheet will be interpreted as part of the glyph. The character set included by default is a Irish Gaelic typeface I made myself including character variants with síneadh fada and ponc séimhithe for the appropriate letters.

P#87641 2021-02-15 00:02 ( Edited 2023-08-25 16:07)

SHOW MORE

Cart #conways_garden-1 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

A little Conway's Game of Life simulation with some slight interactivity laid on top of it. Code is 280 characters. Arrow keys to move about and X to reset.

P#75970 2020-05-06 14:59 ( Edited 2023-08-25 16:06)

SHOW MORE

Cart #bbs_randomiser-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

Simple little cart that tries to load random IDs from the BBS. Try something new. When you've had enough of a cart just select "new cart" from the pause menu. The number in brackets is the ID of the current post it has loaded.

Sadly though I'm seeing weird behaviour with that when I run through the BBS. It doesn't seem to display the correct number when you run this in browser, but it's correct when I run it locally. Sorry about that I have no idea what's going on there. But if you run it locally and want to find the thread the cart you're on is posted to just plug the number in here:
https://www.lexaloffle.com/bbs/?pid=######

P#54584 2018-08-01 20:18 ( Edited 2023-08-25 16:05)

SHOW MORE

Cart #animation_editor-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18

This is an animation editor I've made to help me with my current project. It's made for a very specific use case and I don't expect it to be particularly useful for other people, but might as well post it. In particular it's designed to help compress animations that have lots of repeated elements. e.g. In the example data in this cart the head layer is used across almost every animation, but only appears once in the spritesheet.

To this end it is very much optimised to favour saving space in the sprite sheet, and not optimised for CPU or RAM usage. It also assumes the data outputted is going to be handled in a very object-oriented fashion (see example implementation further down).

I've example animations in the cart (they're for the game I'm currently working on) that should load when the cart is viewed on the BBS, but won't load when run in the normal Pico-8 environment. Feel free to play around with it, but you won't be able to export or save anything from the BBS.


General outline

The editor defines characters, which have a set of animations, which have a number of frames, which each have a duration and ten layers to draw on. General usage is just to create animations, which can be exported via the "export" button. This will create four files:

  • spritesheet.png - the exported sprite sheet to be used in your game
  • metadata.p8l - lua table structure containing all the animation information needed to draw animations from the above spritesheet
  • metasheet.png - the same information, but stored in a different format as image data so that the animation editor is able to re-import it
  • debug.p8l - the exact data as in metasheet.png but in text format, just for debugging purposes

On startup the editor will import any data from metasheet.png and spritesheet.png back in so that you can continue editing where you left off.


Controls

  • the window on the left is for drawing, the ten windows on the right are ten layers each frame can use
  • you can't rearrange or add more layers but the 'c' and 'v' keys can be used to copy and paste the selected layer
  • you need to create at least one character, animation and frame and select a layer before you start editing
  • when entering names only english alphabet characters are accepted. Use enter to submit and / or \ to cancel. Backspace works as you would expect.
  • use the arrows keys to move layers around (no wrapping - going off the edge will just erase data)
  • use the wasd keys to move the origin point
  • use - and + to navigate through characters quickly
  • use [ and ] to navigate through animations quickly
  • use ' and \ to navigate through frames quickly
  • p/f toggles the paint or fill tool. Be warned there's no undo button so be very careful with the fill tool
  • 'oni' toggles onion skinning
  • the 'w' next to it toggles wrapping for the onion skinning. When enabled and viewing the first frame in an animation, the onion skin layer will show the last frame from that animation.
  • 'orig' toggles showing the origin point for the current frame

Implementing animations in your cart

when you have your animations finished you should import the spritesheet into your own cart and copy the contents of metadata.p8l into an initialisation function in your game. You will then obviously need some special draw functions to do something with that data. Here is an implementation I have done as an example, taking a very object-oriented approach.

Cart #animation_viewer-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
18


Change log

version 2.0

  • rewrote large parts of the editor
  • optimised processor and memory usage a tonne
  • fixed detection of identical layers so that they sprites don't have to be in the same position
  • increased number of working layers to 10
  • added processor and memory monitors
  • added example data

version 1.3

  • fixed bug causing data loss on import for large frames
  • fixed bug with duplicate frames being assigned the wrong spritesheet y-coordinate on export
  • changed import process slightly to make each frame try to use the same origin point as the previous frame in the same animation

version 1.2

  • added fill tool
  • added optional wrapping behaviour to onion skinning
  • export process will now notice duplicate layers and only export them once
  • fixed various bugs related to import and export, works much more reliably now

version 1.1

  • fixed play button crashing the editor when there are imported animations

version 1.0

  • editor will now import previously exported data on startup
  • functioning delete buttons
  • layout changes
  • misc crashes fixed

version 0.2

  • fixed right clicking on most elements crashing the cart
  • changed input code so enter and backspace now work when inputing names
P#53620 2018-06-16 23:12 ( Edited 2023-08-25 16:04)

SHOW MORE

Cart #tweetjar-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

I wanted to make a little compilation of tweetcarts for a while and The Pippin Barr Game Idea Jam #2: The Museums Jam gave me an excuse to throw something together. Please enjoy this museum of tweets.

P#52228 2018-05-01 13:00 ( Edited 2023-08-25 16:03)

SHOW MORE

I know Zep has said the API is pretty much finalised so I'm guessing he's not planning on adding characters to the font but I think it'd be nice for the purpose of displaying controls/tutorials to have symbols to represent the start button (for posting carts to BBS) and the return key (for posting elsewhere where people aren't familiar with PICO-8 controls).

I made a quick mock up for them sticking to the 7x5 limit other glyphs use.

P#46664 2017-11-24 15:57 ( Edited 2017-11-27 22:54)

SHOW MORE

Cart #me_too_thx-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

A month ago I posted a thread on reddit/r/me_irl promising to make a game based off whatever the top comment was - this was the top comment:

"a SSB esque fighting game between all the frog memes (Wednesday, Dat Boi, Pepe, Kermit, etc.) and name it "Me too thanks""

P#42273 2017-07-08 11:45 ( Edited 2023-08-25 16:02)

SHOW MORE

Cart #game_of_life_tweetcart-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Ok with a bunch of help from LRP I have an entry that works in 138 characters! I'm so happy I managed this. I didn't think I'd actually be able to compress it this small. It was a lot of fun to do.

code:

k=2^13::s::for a=0,k do
n=0 for x=0,8 do
n+=peek(k*3+a+x/3+x%3*64-65)end
poke(a,n==12 and 4 or n==16 and peek(a))end
memcpy(k*3,0,k)goto s

Original post:
Was trying to make Conway's Game of Life into a #tweetjam entry but wasn't able to get it below 175 characters. It reads the screen to do the simulation so while it will always display the same simulation from the BBS you can do whatever input data you want if you download the cart by having whatever you like on screen when you hit run.

If anyone can spot a way to compress it more please share!

version 1:


version 2:
version 3:

P#39440 2017-04-09 05:30 ( Edited 2023-08-25 16:01)

SHOW MORE

Cart #super_fash_bash-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
24

I entered a game jam a couple of weeks ago with the theme of "punch nazis". This is the result of my efforts - Super Fash Bash runner up for the "Best Nazi Punch" award for the jam.

P#37983 2017-03-01 17:09 ( Edited 2023-08-25 15:58)

SHOW MORE

Final Edit: ultrabrite has pointed out that zep's official word on it is

"Multicart exports offer a way to package and distribute what you can already do with local files (e.g. zipping up a group of carts), but isn't supported on the BBS and probably never will be. I think feeling invited to design for single 32k carts is an important aspect of PICO-8, so separating multicarts to the exporter is a way to preserve that to some degree while still broadening the scope of what can be made with PICO-8."

From the 0.1.10 release thread: https://www.lexaloffle.com/bbs/?tid=28168

Original post:
Hey I looking into the idea of using the reload() function in the game I'm working on to possibly store data for extra levels on a separate cart and load them in as you progress. I understand that the HTML5 export explicitly supports multiple carts but I'm not clear on if it's possible to upload multiple carts to the BBS and be able to access data from each other?

Edit: Testing with a simple two-cartridge system I made

Cart #37523 | 2017-02-16 | Code ▽ | Embed ▽ | No License
3

Cart #37524 | 2017-02-16 | Code ▽ | Embed ▽ | No License
3

Edit2: Looks like it doesn't work when referencing them by their filenames when I post them to the same thread anyway

P#36963 2017-01-31 08:24 ( Edited 2017-02-17 09:16)

SHOW MORE

Cart #tiny_nokia-0 | 2023-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
14

My first submission, I hope I have this correct!

A classic game of Snake. Start it up with the tab key then use the arrow keys to guide your snake to the food that appears, just don't crash into yourself!

Eat 15 fruits in each level to advance to the next. With each level the speed increases.


Changelog

v1.2

  • Removed screen shaking on input
  • Rewrote input code to hopefully feel more responsive
    v1.1
  • Reduced the level of shaking on input
  • Stopped certain input combinations allowing you to turn backwards into yourself
P#35950 2017-01-17 17:31 ( Edited 2023-08-25 15:57)

Follow Lexaloffle:          
Generated 2024-03-19 11:01:16 | 0.085s | Q:55