Log In  
[ :: Read More :: ]

I've been trying to wrap my head around saving and loading in Picotron.

As always feel free to correct or improve, I'm always happy to learn.

2 main concepts to understand

As far as I know there is no automatic allocation of space for persistent userdata like in Pico8. You save your userdata as you would in other conventional game engines as an extra file. This makes it a whole lot easier.

This data is best stored as a table, so try player_vars={"Tammo",{"Sword",1},}. That data structure is internally stored as a .pod, which can be saved or read via store and fetch respectively. (Otherwise you'll have to arrange your data and pod it before saving just to unpod it after loading it.

Now you'll just need a place to store your data. It is good practice to create your own folder inside /appdata with mkdir. For example mkdir(save_dir)

These files can be opened and read, but this is fitting for our open community. Let's imagine the easiest possible usecase. We want to keep track of the highscore. We need to check for any existing high scores on _init and load them if they exist. If not we'll just start with the default value.
Here are the functions needed, tune them to your usecase:

function save_game()
local err=mkdir(save_dir)
if err!=nil then

function load_game()
local presave
    if presave!=nil then
        print("loading succesfull")
        print("no save file detected")

These functions need both a save_dir and a save_file declared in your _init to be globally accessible.


In this case we also need our player vars:


And please do correct me if I got it all wrong. Have a nice day!

P#145887 2024-04-06 13:02 ( Edited 2024-04-06 14:09)

[ :: Read More :: ]

Cart #picowings-2 | 2024-04-06 | Embed ▽ | No License

Altough I was born a little too early to call this a "childhood" game I can still appreciate it's relevance of this game as a good first game for any beginner programmer. Enjoy!

Flap with Mouse or Up

I'd love feedback on the code if anybody is willing :)


  • incorporated @Cutievirus feedback, it feels way better now. Thanks! (fun sidenote: All I had to do was shift "-" right once.
  • made it playable with the up button-making this a single button game. Thanks for the feedback, @ahrotahn

UPDATE 6.4.24:

  • added automatic saves
P#143696 2024-03-18 14:06 ( Edited 2024-04-06 13:04)

[ :: Read More :: ]

Cart #cavedivinggonebad-1 | 2024-01-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

This game is inspired by NuSan's brilliant Flooded Caves, it is a fan game :)

It is your job to save people who went cave diving from drowning! Water is entering the caves, use your drill to carve tunnels to redirect the flow of water and try to save as many people as you can.


X or V or Left Mouse Button to carve
Arrows or Mouse to move the cursor

The difficulty still needs some finetuning, do let me know how you like it! The Cave generation is based on GPT`s idea of a Noise Algorithm, I might clean it up in the future cause it was useful to me.

Update 6.1.24

  • Updated the menu to reflect the inspiration by Flooded Caves by NuSan
  • renamed "Easy" to "Learning Difficulty" and made it even easier and quicker
  • added rescue animation and sound
  • some bugfixes
  • a nod to @NuSan in the game's menu
  • added a "perfect win" indicator when you manage to save everybody
P#139584 2024-01-03 17:22 ( Edited 2024-01-06 12:36)

[ :: Read More :: ]

Cart #j_t_nightmare_realm-4 | 2023-11-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I procrastinated my Godot Project by creating this game instead. I got a timelapse of the coding process over on Mastodon, it was all done this weekend. So please excuse some messy code bits. Anyway.

Journey Through The Nightmare Realm

You (and up to 7 friends) awaken in a dark dungeon. Nothing is as it seems. You have to stick together to not loose one another in the ever changing layout of the dungeon. The dungeon seems to keep track of your progress and rewards you with some stairs leading deeper into the dungeon every so often.


Player 1:
X to Shoot
Arrows to move

Player 2:
Q to shoot
ESDF to move


Connect up to 7 controllers to play with up to 8 people at once!

The first player is the "king/queen" (notice the little crown), if they die the game is over for everybody. The other players can respawn with a totem.


The heart that replenishes 1 HP

The Totem that can bring back a dead friend(if you're playing with friends)

The pistol you know and love, slow but reliable

The submachine gun you long for, try not to swap it for a pistol

(NEW) The shotgun has quite the knockback, but it one shots the grunts


-12/11/23 Refactored a lot of maps, made it harder without testing them. Reduced max HP. This is gonna be fun.
-12/11/23 Fixed a collision thingy, refactored some more maps and added whimsical minimal animations
-13/11/23 The Blooddate: Added the shotgun, a LOT of blood and made some more balancing changes
-13/11/23 Added 30 FPS and a menu option to toggle the gore(thanks, Kevin Trepanier)

P#137325 2023-11-12 19:24 ( Edited 2023-11-13 20:32)

[ :: Read More :: ]

Cart #seekingthebeast3-2 | 2023-10-28 | Code ▽ | Embed ▽ | No License

This is the third installment of my longest-running series:


You and your friend went cave diving, but now it is getting dark. It is widely known that staying outside when it is dark is not a smart move as a giant beast roams the lands. But your friend lost the key to the gate house! Recover the key and get home safe!


Arrow Keys Move
C Attack
V Block and Interact


This is a rather ambitious try to create a 3d RPG engine for future demakes. It is a short game, more like a little tech demo, and i hope you enjoy it. It was created with the help of Mot`s Instant 3d plus! and some of amusicians pixel art from a former, abandoned project.

Notable Features:

-Inspired by the books in Morrowind I added a possibility to display books containing clues about the world you're in. This allows for some more immersive worldbuilding
-3d-Particle Engine that kinda runs okay
-classic RPG scrolling texts
-a multiphase boss fight
-a speedrun timer! (my best is 3:42"133)

Quickfix Update:

  • fixed some spelling errors
  • fixed a respawn altar location
  • fixed the player getting stuck in the attack animation upon death or in the boss fight
P#136536 2023-10-28 14:37 ( Edited 2023-10-28 17:00)

[ :: Read More :: ]

Cart #show_book_function-0 | 2023-09-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

This is a function that draws a book with some custom content to the screen. My inspiration was morrowind and its plethora of books. All this function needs to work is an external,global page variable.

How to use:

  • copy this function to your code
  • declare a global page variable (that starts at -1, which is the cover page)
  • keep in mind that it resets camera() to print the book on screen regardless of the camera offset, so use it after you already printed you game with desired offset
  • add your book as a pair of title and a long content string like this: {"Title","Super long and cool content"}, to the books table
  • consider using P8SCII to achieve certain effects cheaply - it breaks the function in fun, weird ways
function show_book(title)
    local given_title=title or "how to use show_book"
    local books={
            {"how to use show_book",
            "this book will teach you how to use the show_book function in pico-8. the show_book function takes a given title and displays the book content on the screen. you can use the⬅️ and ➡️buttons to turn the pages, and the 🅾️ button to exit the book. you can also add your own books to the books table, as long as they have a title and a content string. the function will automatically split the string into lines and pages, and draw the book cover and pages for you. you can also change some variables in the function, such as the maximum length of a line, the maximum number of lines per page, and the colors and positions of the book elements. to use the function, you need to call it with a title argument, like this: show_book ('how to use show_book'). have fun reading and writing books with pico-8!"
        local function split_str(str,length)
            local max_length=length or 13
            local strings=split(str," ",false)
            local result={}
            local cur_str=""
                for i in all(strings) do
                    if #cur_str+#i<max_length then
                        if #cur_str!=0 then
                        cur_str=cur_str.." "..i
            return result
        --end split_str

        local function draw_cover(tit)
            local title=split_str(tit,11)
            local line_nr=0
            for i in all(title) do
        local function give_book(tit)
        local title=tit or "the hanging tree"
            local book_lines={}
            local lib={}
            local ret={}
            --lookup the book and split
            --the strings
            for i in all(books) do
                if i[1]==title then
            for i in all(book_lines) do 
                if #lib==10 then
            return ret
        end--give_book end

        local content=give_book(given_title)
        --dislay background
        if page>0 then
            --draw the book itself
            --page numbers
            --print left page
                for i in all(content[page]) do
            if#content+1>=page then
                --print right page
                for i in all(content[page+1]) do
        elseif page==-1 then
            --draw the book cover
        if page+1<#content then
        if page>-1 then

401 tokens

P#134830 2023-09-24 09:23 ( Edited 2023-09-24 10:21)

[ :: Read More :: ]

Day night cycle

Hi! I made a function to add a day night cycle. It shifts the palette and takes two arguments, hour and minutes. The palettes can be modified.

First you can see it in action here:

Thing to note

  • The night palette is very different from the rest, adjust it based on your sprites. Originally this palette was made by Achie72
  • It is very token intensive at the moment. That can surely be optimized by either cleverly contstructing the palettes at runtime or deleting those you don't use. But I kept it like this for readabilities sake.
  • Maybe adjust the time to your needs. I took a shorter day as a model but you could also change the times(ho=hour in the function) in code
function set_pal(h,m)
local pals={
--night palette from achiegamedev - thx ♥
--regular second palette
--sharpen contrast
--introduce greens
--introduce yellows
--introduce reds

local ho=h or 12
    if ho<7 then
    elseif ho==7 then
        elseif ho==8 then
        elseif ho==9 then
    elseif ho==10 then
    elseif ho==11 then
    elseif ho==12 then
    elseif ho==17 then
    elseif ho==18 then
    elseif ho==19 then
    elseif ho==20 then
    elseif ho==21 then
    elseif ho>21 then

I hope this is useful, have fun with it!

P#129023 2023-04-25 19:23 ( Edited 2023-04-25 19:24)

[ :: Read More :: ]

Pico Valley!

I love that cozy games are finally getting big, and one of my favorite cozy games is,without a doubt, Stardew Valley. I played Harvest Moon growing up and enjoyed it a lot, but when somebody told me about Stardew Valley my mind was just blown. This is why I decided to make a Stardew Valley demake that i could have played growing up.

Cart #picovalley-2 | 2023-11-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I hate reading old code. Well at least I can be sure I got better since April :D Let's go.

  • added the ability to play the brilliant Journey Of The Prairie King Demake which was quite the undertaking. A lot of things needed to work together in order to return the player to the original game with all of the progress saved. Read more about it on the Journey Of The Prairie King page.
  • repixeled a lot of sprites, toned down the contrast
  • added the graveyard
  • added the saloon and 2 new NPC`s
  • added save file detection
  • rewrote token wastezones(the rest of the code is still a hot mess though)
  • adjusted the time scale to 0,7 of the previous value
  • increased the maximum energy
  • added an interaction indicator


  • rebalanced some values
  • you now loose some items if you fall unconcious
  • made music track longer
  • update mining palette

It is a 64x64 recreation of Pelican Town and some of its residents. The code started out clean but got messy fast because i wanted to finish this game.

I made some boxart and a manual for the game:

Before i upload this to itch.io i wanted to upload it here. Here are a few pages from the manual:

Things to note:

-if you want to keep your progress open the game in Pico8, your progress is saved on every new day
-get your fishing rod at the beach
-enjoy yourself and don't hesitate to report bugs!
-this is somewhat modable and i encourage everybody to make their own little town and characters. There is some (but not a lot) of documentation in the code to get you started.

P#128883 2023-04-22 10:19 ( Edited 2023-11-18 13:39)

[ :: Read More :: ]

Cart #starjumps-2 | 2023-11-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


This is Version 1.1 of StarJump, the lightsaber-themed JumpNRun.

What is it about?

You are a lightsaber wielding somebody trying to get from point A to point B as quickly as possible. Use your lightsaber skills, jumps and runs to beat all 3 levels and, if you can, collect all 10 stars per Level.

How to play

Use X to attack and O to Jump. Press X+O together for a higher dash. Note that you can doublejump! Also note that you deflect laser shots whilst you're attacking.

Good to know

You can restart the current level via the pause menu, you'll also find an option to toggle the timer and music.

Why is it so hard?

To be honest levelbuilding just got out of hand. I enjoyed it way too much. But to proof to you that all 10 Stars are achievable in every level I'll show you my times:

The Future?

Things i`d like to get done if i find time:

  • nice parallax backgrounds
  • better music
  • rework pixelart
  • rework particles

Update 20.11.23

  • You now get to keep your collected stars after you die.
P#119971 2022-11-01 21:28 ( Edited 2023-11-20 14:42)

[ :: Read More :: ]

Line Of Sight Function

I`ve created a Line-Of-Sight function that should work for most projects. It checks for map-collisions(using flag0 as the collision layer). Please use it and let me know what you do with it!

I was inspired by this post: https://www.lexaloffle.com/bbs/?tid=48889
But i wanted a simpler starting point for my own approach. A Line Of Sight check is a good starting point for you own approach but also involves some math. So to bypass that step use my function:

UPDATE 16/9/22
added a optional length-variable. Use it to define a max "range" of the that line. Keep in mind that the function already neglects far away points.
Also added a new break point for perfomance.

function can_see(x1,y1,x2,y2,length)
--x1 and y1 are the point of view,length is the max distance of the two points
    local max_length=length or 1000
    local xvec=0
    local yvec=0
    local len=0
    local ret=true  
    local tx=x1
    local ty=y1
    if len==0 or len>max_length then
    if ret then
        for i=1,len do
            if fget(mget(flr(tx/8),flr(ty/8)),0) then
    return ret

Features (if you're intrested)

  • handling LOOONG Distances with a big "Nay" from the function
  • always checking from x1/y1 point of view
  • stopping when no more calculations are necessary

How it works

  • set standard return to a yes (true)
  • create a directional vector from 1 to 2
  • calculate the distance of that vector
  • check wether that distance is too big
  • normalize it(max it out at 1) with that distance(so your steps don't get bigger than 8(which would skip a whole sprite, thus negating the whole point of this function))
  • loop through incremental steps with that normalized vector
  • check for collisions on each point
  • if a collision occurs change the output to no and exit the loop to save power

How you might use it(and how i use it)

  • Use it for a stealth game and combine it with the general direction the enemys are facing
  • Use it for shooting stuff to see how far things will go
  • Use it as a starting point for a raycast by returning the distance the ray traveled (I'd like to do that too)
  • I'm making my first roguelike to learn about Mazecreations and get better at making fights fun (Which i'm terrible at)
  • in this game the enemys, similar to that post linked above, remember the last point where they saw you and approach that point(the white dot). They also have a timer, so they only try to spot you every now and then.

You can find a minimal setup for the function right here:

Cart #lineofsight-1 | 2022-09-02 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#116768 2022-09-02 10:18 ( Edited 2022-09-16 06:44)

[ :: Read More :: ]

Cart #bobcoterminal-0 | 2022-08-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

BobCo(TM) Terminal v1.0

I'm pretty sure somebody already tried this, but I didn't want to spoil the fun for myself by seeing somebody else's great work before having my own go at it.


For everybody who hasn't played fallout: You have to guess the correct password by choosing from a set number of passwords. If you get it wrong the terminal tells you how similar the password you chose was to the password that you have to guess.



I replayed some Fallout in the last weeks(that I spent without the internet(damn you, internet providers)) and fell in love with their take on the retro-styled terminal.
I also thought it would be a nice exercise to get comfortable with string manipulation. And then I had to stop myself before it got too messy.
This is really just a small demo thing showcasing my take on the terminal with some lame jokes.
I wrote a neat function for comparing strings, if somebody needs one you may copy it. The rest of the code is a mess because I did it all in a day around work.

For anybody who is interested:

I split() two strings and then iterate through that new dictionary in a for loop. Each turn I check whether the two dictionaries have the same letter in the same place and, if they do, I add 1 to a score. In the end I return that score.

The part that is much more interesting is mixing the words and some other nonsensical special characters for that "hacky" look. There is a dictionary with random characters and a dictionary with the chosen words. The table you see in-game is itself another table consisting of 8 lines. Each of those lines gets filled character by character. There is a set gap between words that gets filled with nonsense. The chosen words dictionary gets chopped up again and sprinkled into the mix. Et voila! A "hacky" block of text.

Oh and i really hope @dw817 sees (and plays) this.

P#115619 2022-08-11 19:31 ( Edited 2022-08-11 19:34)

[ :: Read More :: ]

Cart #shelfdefence-0 | 2022-06-05 | Code ▽ | Embed ▽ | No License

I entered my first game jam and did my first collab with amusician. Find it on Itch.io
This was made in 3 hours.

Shelf Defense


Press ⬅️➡️⬆️⬇️ to move and jump

Press ❎+⬇️ to move lower

Press ❎+⬆️ use your jetpack

Press 🅾️ + Place a chosen Toy

„Beware! Capitalist children want to grab you off the shelf. Use their money against them and hire other toys to fight back“

Shelf-Defense is a genre mix with tower-defense and platformer elements made in Pico8.

AMusician made his debut with this game as his first ever published game!

Published as part of the 3 hour game jam trijam172 „off-the-shelf“.

Made by Taxicomics and Amusician

P#112742 2022-06-05 10:12 ( Edited 2022-06-05 10:13)

[ :: Read More :: ]

Cart #nothalflife-0 | 2022-03-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Hi everybody!
There is a game that is near and dear to me, and i always wanted to demake it. But because I´m scared of lawyers and publishers, i never did. I made a completly new game, and any resemblance is merely a coincidence.
I hope you enjoy, let me know what you think.

X to shoot
O to interact
O+Arrow to change weapon

You are Gordan Teeman, an experimenter in sector D of the Black Laser Research Facility in New England.
Today is a big day, you are taking part in a monumental experiment. Let´s hope everything goes according to plan.


  • Lots of bullets
  • Speedrun Timer
  • 5 types of enemys
  • all the particles
  • messy, unreadable code
  • all the pixels
  • a huge map
  • nostalgy
P#109372 2022-03-29 20:07 ( Edited 2023-09-11 19:30)

[ :: Read More :: ]

Hi everybody!
I'm definitely NOT making a Half-Life demake and i need some help with SoundFX. I´m sure some here are familiar with the NOT Source material, i want to nail the sound effects in pico8-scope. Just post them here and I'll be sure to credit and thank you.

It´s NOT going to be a quick summary of the events in the Black Laser Reserarch Facility through the eyes of Gordan Leeman.
I´m still looking for perfect step sounds, weapon change sounds and enemy grunts. And of course any help is welcome, if you got more ideas. Thank you very much <3

P#109193 2022-03-26 10:45 ( Edited 2022-03-26 10:56)

[ :: Read More :: ]

Cart #pictris-2 | 2022-03-23 | Code ▽ | Embed ▽ | No License

UPDATE 25.3.22
-removed a bug where the speed wouldnt reset for a new game

Turn: X
Move: Arrows

Feature Creep has stopped me from finishing games so I started making some classic games. This time: TETRIS
It was fun, and it was nice overcoming the challenges this game brings.


  • Jelpi
  • softlock
  • all the Tetris stuff
  • awful music
  • 12 Levels
  • changing scenery
  • persistent Highscore Data
  • very messy code

Have fun!

P#109059 2022-03-23 16:34 ( Edited 2022-03-25 13:11)

[ :: Read More :: ]

Cart #flapico-4 | 2022-03-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Fixed the bug where you could fall so far beneath the level that you would never collide with anything. Thx @Mot!
Holy diver, dear game, please let me be. Sooooooo. I HAD to reintegrate the difficulty ramping, and i figured i have to explain myself a little better.
This is my first attempt at a tweetcard. It was completely unexpected for me, but i enjoyed optimizing A LOT!
I learned how to shorten if statements, prints and everything else from the great articles people wrote about tweetcards.
Press X to flap,
beat my score of 33.
Oh yeah, and its 278 chars now :)

Ok, the critic won, i remade it to be tweetable, i preserved the highscore but had to axe the difficulty ramping.
Thx for any suggestions to further enhance!

Original Post:
I tried to make flappy bird in under 500 chars.

Have fun and suggest ideas to push it sub 400!

P#108109 2022-03-06 01:49 ( Edited 2022-03-07 13:43)

[ :: Read More :: ]

Cart #smalltalksimulator-1 | 2021-11-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I´m on a party but i like coding more. Have fun with this.

P#99715 2021-11-07 00:00 ( Edited 2021-11-07 11:27)

[ :: Read More :: ]

Cart #picophobia-0 | 2021-09-17 | Code ▽ | Embed ▽ | No License

Picophobia(Phasmophobia Demake)

I love the original game and the genre it has kicked off. So for it´s anniversary i made a Pico8-Version that you can play with two people. I used AFBUs great raycasting engine(https://www.lexaloffle.com/bbs/?pid=13195#p) and modified it a bit to fit my needs(mainly being a splitscreen game). I´m still working on incorporating sprites, but we´ll see wether i can figure out the math in the future. Any help would be appreciated!
Use X in the Van to equip the different tools and write down your findings in your Journal (press O)

Have fun, tell me about your sightings and feel free to modify or add levels!

P#97459 2021-09-17 14:48 ( Edited 2021-09-18 07:21)

[ :: Read More :: ]

Cart #drumsterfire-1 | 2021-08-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Hi everyone!
I made a drum sequencer intended for live use. It has control over 4 channels (kick, snare, hihat, tom) in 32 steps.

Use X to toggle a slot or a setting, use O to change from the grid to the controls. The first control slot is play/pause, slot 2-5 toggle the 4 channels on or off, + and - control the BPM. The BPM is rounded, let me know whether you need accurate BPM.

If anybody has an idea for different drumsounds etc. do let me know but for now- enjoy!

P#96615 2021-08-29 11:16 ( Edited 2021-08-29 11:21)

[ :: Read More :: ]


Cart #seekingthebeast2-2 | 2021-08-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I made a sequel to my first game ever "Seeking The Beast" from 2008.
You are trapped in a valley where a Beast has gone wild. It created havoc and it has to be slain.

My best time was 10:15 Minutes. Can anybody beat that?

Let me know what you think, and have a great day!

Update: Added a Speedrun-counter and explained the ending better 15.8.21

P#96307 2021-08-21 10:38

View Older Posts