I've been putting some pico-8 games up on a personal website since it gets past an annoying block list, but I've noticed something strange. The games with highscores that save via cart data sometimes get reset back to their original states with none of the highscores. I checked in the developer menu and saw that cart data was being saved to local storage in the browser. I'm wondering if this is a known issue, hopefully with a known solution, or if there's something I'm doing without realizing it that's causing the data to be reset.
Thanks
This is my take on the wave function collapse algorithm in one of its simple variants : the simple tiled model.
Given a set of tiles and some adjancency rules, the algorithm tries to produce an image. It can be used for levels generation, pattern-like backgrounds and can also be used for non-visual data.
How does it work ?
This cart contains a few demo tilesets and rulesets that you can navigate between with the left and right arrows.
Sometimes the algorithm gets stuck (shown with red tiles). This happens when there is a contradiction : the rules won't allow any tile to be placed on a position. Press X or O to restart.
Yeah but, really, how does it work ?
One-Off GFX
To display fullscreen images with a PRINT command. It doesn't take any space in your spritesheet, it uses p8scii one-off characters all in one string (~3000chars if used properly).
This is an old school method widely used in the 80s (e.g. on ZX Spectrum): each 8x8 block had a foreground (ink) and background (paper) colour, monochrome but using the colours well would deliver excellent pictures for title screens.
Now, One-Off GFX is based on that method but could also have more than two colours in a single block (at the expense of extra chars).
So -differently from other image compression methods- it doesn't really matter:
- how complex the pixel patterns are in the gfx (dithered or plain)
- how many colours are present overall on the screen
It just depends on how many colours are present in each 8x8 block; better keep it less than 4 and possibly just 2 in most of the blocks choosing wisely while drawing or editing the pic. A good drawing tool to improve monochrome skills is Multipaint (choose c64 hires mode)
Yo @zep,
I realize returning nil
out of bounds is less "friendly"-seeming, but after reading another post in here, I realized it's way more useful.
For one thing, it should make this work:
plain_text = "my thing that is mine" label = "" for c in all(plain_text) do if c == ' ' then label ..= '_' else label ..= c end end print( label ) -- "my_thing_that_is_mine" |
(Right now it never stops because the iterator keeps seeing ""
instead of the nil
it needs to terminate.)
And for another, returning a nil is much more likely to alert a programmer that their code is probably malfunctioning than returning an empty string. Accessing out of bounds is usually erroneous and should therefore trigger errors.
I realize some apps are probably already abusing the fact that you get an empty string when referencing past the end of the string, but really that's a bad programming pattern to be teaching people anyway. It's lazy, you should know where the end of the string is and stop there instead of expecting the OS/API to be your nanny and stop you from walking off of a cliff.
Snake+
For my first "completed" project, I wanted to build something small and fun while getting familiar with Pico-8 and lua.
I'm not sure if I'll continue working on this, but would love any ideas/suggestions!
older versions:
My new game - made in pico 8 edu
-plot-
Bogg's 9 beans have gone missing!
He needs at least 4 to make his casserol!
Now go find them inside the mountain and bring them back to his house!
-controls-
arrows to move
x to see inventory
-Code by me (toblerone aka rinkachi-rinkitata) -
-Thanks to @thattomhall for who stole the coal? https://www.lexaloffle.com/bbs/?tid=40913 -
Small minesweeper clone.
Keyboard controls: Arrows to move yellow selector. x to flag, z to sweep.
Mouse controls: left click to sweep, right click to flag.
sweeping on already cleared cells auto-flags or auto-sweeps if the solution for the square is clear from the label and adjacent uncleared or flagged cells.
Hey all,
So what I'm trying to do is this... I've used a rotary spinner controller that reads as a mouse axis on other platforms before (Unity). I can get the 'velocity' of the spinner controller by reading the difference in mouse X values between frames. I enabled mouse support on PICO-8 to try a similar thing with PICO (a rotary spinner PICO-8 game! How cool would that be, right?); however, I noticed the mouse position no longer updates beyond the end of the screen, which is somewhat expected. In fact, I don't know why it works on Unity/Windows. This means the 'spinner' has a definite start and stop and I can't spin the spinner indefinitely and continue to measure its virtual velocity in this way.
Is there a way.... to 'write' a new mouse position so I can have the mouse 'wrap' around the edge of the screen? I know this is sort of an.... off the wall issue to be having but any thoughts are appreciated!
Nick
NOTE: In order to play this game online, go to https://pico-pong-online.herokuapp.com/
This game is one example of how to make online multiplayer games with pico-socket, a new library that I've been working on, that came out of a collaborative project with Ethan Jurman and his Tiny Tanks game
You can read some of the finer details about the pong game here: https://github.com/JRJurman/pico-pong-online
For a smaller example, and details around the library, and how to use it, check out the project on github. Below is an abridged version of the README and how it works:
Hello, it's me again! After finishing the Asteroids clone, I wanted to make a "sister" game of sorts, so I made a Spacewar clone! Including gravity, and a sun to crash into! No AI, so you need a second player to play this with! It took a bit of time to get the second player to work, having to convert the player into a tabled object. I hope this one works well, too!
Thank you very much!
Hello, im wondering why the velocity and acceleration (vx and va) dont go to zero when you go left then let go.
Also note that the maximums are different.
Controls:
Left -- go left
Right -- go right
X -- force vx and va values to zero
is this just a quirk with pico-8?
Thanks :)
Code:
[hidden]
function _init() x=0 vx=0 ax=0 end function _update60() if btn(➡️) then ax+=.01 end if btn(⬅️) then ax-=.01 end if btn(❎) then ax=0 vx=0 end vx+=ax x+=vx vx*=.9 ax*=.9 end function _draw() cls() line(x,0,x,127,7) print(vx.." velocity",0,0,2) print(ax.." acceleration") print(x.." x") end |
Can you manage the endboss?
This is a shoot-em-up mini-game.
It is very short. But my boys and I are proud to have programmed our first own computer game.
Update v1.1:
- Collision behaviour of bullets on walls
- Nomalised movement in diagonal directions
Thanks to Ancient Pixel, phil, Aktane and otto_piramuthu for their help and ideas
[128x128] | |
𝕳𝖊𝖑𝖑𝖔 𝕭𝖔𝖎𝖑𝖘 & 𝕲𝖍𝖔𝖚𝖑𝖘 !
What's that ? You got Halloween on the brain ? Well who wouldn't !
It's that spooky time of year where things go bump in the night and you watch scary movies with popcorn and friends.
So having looked at the many programs of LIFE and how the pixels behave I thought I would one up this and create DEATH. Yep. Truly a creepy decay program, based on GFA code I wrote 20-years ago called "Plague," although there I had true 24-bit color so it was much more colorful and spooky.
(v00 10-20-22) TO LOAD THIS PICO-8 CART, in immediate mode, type:
load #mcaf
I'm working on a bullet pattern function that shoots out bullets in a direction, at a speed, etc...nothing fancy and nothing new to me, all my games have bullets! BUT this time some bullets are magically moving mid-stream and I can't figure out why.
See here...
I've narrowed it down to happening when bullets from the line ahead of it get deleted from the table. When a bullet goes off screen, I'm removing it from the table so as to not get overloaded and so on. Normal stuff. But when that deletion happens, the next bullet in the table magically moves out of line yet all the rest follow orders.
If there are 15 bullets in every line, why would the 16th bullet move when the ones ahead of it get deleted? Is it something to do with table order? Or some process not happening due to deletion time?
It's like the addition math gets skipped at that moment. Very weird...but also something I'm sure that is very simple I'm overlooking. Lord knows I've spent way too much time on whittling this down the simplest version and I'm not sure how to refactor any more. A man can only bang his head so much :)
Any thoughts, insights, or suggestions are appreciated.
Code for the example above.
function add_bullet(x,y,a,s) local dx=cos(a)*s local dy=sin(a)*s add(bullets,{x=x,y=y,dx=dx,dy=dy}) end function bullet_update() for k,o in pairs(bullets) do o.x+=o.dx o.y+=o.dy if o.x>130 or o.x<-5 or o.y>130 or o.y<-60 then del(bullets,o) end end end function bullet_draw() for k,o in pairs(bullets) do rectfill(o.x,o.y,o.x+1,o.y+1,8) end end function _init() fr=0 bullets={} end function _update60() bullet_update() fr+=1 if fr==50 then -- this is here to repeating demo only for i=1,15 do add_bullet(120,10+3*i,.5,1) end fr=0 end end function _draw() cls() bullet_draw() end |
Deep in the House
Version 1.1
Deep in the House is a short horror game.
After a long and tiring walk, you wander into an old house with an open front door, hoping to find shelter.
As you enter the main hall, the door closes and locks itself behind you.
It looks like this house isn't as welcoming as you'd hoped...
Will you make it out alive ?
Explore the (many) rooms of the house as you try to find a way out.
You'll have to fight enemies, collect items and solve (simple) puzzles.
It is recommended to play with sound if you have the option.
Controls
Move with the arrow keys.
Tap left or right twice to run.
Press C to show the inventory and health status.
Controls & Rules
⬅️⬆️⬇️➡️ - Move the snake!
Z - Next line in conversation | Start game
X - Undo previous move | Respawn
Snakedventure
Move around the level finding fruits to eat and grow longer, but there'll also be rooms to unlock, NPCs to meet, and quests to complete! Once you've found all the fruits and are of the right size, slide your way into a very special sweater from a special someone.
Quarterly Made Games HK
Quarterly Made Games HK is game development collective based in Hong Kong with the aim of developing and finishing personal project(s) every 3 months. It’s low stakes, low pressure, and focused on motivating people with a shared environment and deadline.
(v01 10-20-22)TO LOAD THIS PICO-8 CART, in immediate mode, type:
load #bruteforcepw
Hello.
I was looking at the source-code of @Guest122's program:
https://www.lexaloffle.com/bbs/?pid=119387
To guess someone's password and while his has a dictionary, I did want to point out just how quickly and how unsafe it is to have a small password for instance on one of your internet accounts.
So I wrote this program. What it does is allow you to input a 4-letter word via the regular joystick and then through brute force go from AAAA to ZZZZ to find what your password was, and tell you how long it took to search.
Is there a plan to add multiplayer to PICO8 ?
As it is a virtual console, it would be super awesome to have a native way of simply doing lockstep simulation with rewind to cope with network latency, but that means pico8 has to implement it. Ideally just relying on a STUN server, so it works without config on a LAN, and with very simple config on the Internet.
I don't know which category to post it, so if someone who know moves it to the correct one, I'd be glad.