I’m trying to print text centred around a point.
At the moment my code offsets the x coordinate by half the width
of a string in pixels, calculated as (4* #s)-1
.
This works fine for
alphanumeric text but is wrong when the text contains glyphs.
Is there a built in function to help achieve this?
Or do I need to examine every character when computing the pixel width of the text?


A quick little function to draw 9-slice boxes. Has modes for stretched or repeated sprites along the borders, and an optional background color. A little heavy for general use at ~444 tokens, and could probably be optimized further.
Use:
nineslice(x origin,y origin,width in px,height in px, sprite index for upper left corner, stretched mode (true/false), background color) |

Title says it all. I don't know a lot about Lua but I do know that in general VMs operate on similar principals to hardware description languages, which can be implemented in real hardware. Besides being a ton of work (and needing access to the lowest-level bones of pico) what is stopping a true hardware version of our favorite fantasy console from existing?
The biggest thing I can think of is that carts would be a whole beast of their own, but I'd love to hear everybody else's thoughts, including if there are any good hardware emulators out there (I've seen a few raspberry pi versions, but many of them fall short when it comes to screen, buttons, ports, size, etc).

This was our entry for last Ludum Dare. Forgot to post it here, sorry i dumb!
Team Cardboard Box presents… JBA: Oversequel
You are a bounty hunter. Your target is a bounty hunter. Everyone around you is a bounty hunter.
Interrogate passersby of the whereabouts of your target, once you see them, grab their attention - a light tap on the shoulder, or a bullet to the knee - anything goes! From there, only you decide which one would reap the reward.
And be careful! Anyone around could recognize you as their target!
—– INSTRUCTIONS —–
Walk with the D-pad, shoot with Z, talk with X.. but that much is written on screen. Out of battle with your target, holding Z locks shooting direction to aid with fighting those who want your head
Look carefully at your target’s face. It could give you a clue about their abilities!
Now, go! Survive in this wasteland where anyone ought to get anyone! Will you be able to reach the 11th day?
First, thank you to everyone in the Pico-8 community for being so amazing. With a heavy heart, I have had to regretfully shut down PlayPico after 3 years. I no longer have the time or finances to maintain the site, as I have a very demanding job and a 4th child due 3 weeks from today (PlayPico was a labor of love and cost around $30/mo to run). Other than the finances, I simply don't have the time; the site required a lot of maintenance, and over the past 3 years, I probably invested over 1000 hours into development and maintenance. It started growing in users to the point where more and more new features were becoming absolutely necessary, and it was getting neglected. Several key features were also broken after the BBS updates, and while I fixed many of them, I couldn't find time to fix all of them or continue to keep up should the same issues arise again.
Thanks again for everything, everyone! I hope PlayPico at least brought you all some joy, that's all it was ever meant to do. I'm sorry that it can't continue, but I hope it served you all well while it was there. It had a good run.



A reimagining of the rules of chess.
I don't have anyone to test the game with, so if anyone plays a round, I would absolutely LOVE your feedback. there are very many issues still such as the lack of a two-space pawn move, and no victory event, but I hope to have those finished soon and I hope you can still enjoy what I have made. I also hope you can understand the concept without the tutorial :/
thanks for checking out my game!
Update 2022-11-03:
If anyone decides to play, here is the basics:
- a turn is made of two actions
- action 1: paint a tile
- action 2: move a piece
The idea is that the way pieces move is determined by the color of ground, rather than only by directions.


Hey all,
I noticed that my game, Bubble Pond, has been hosted on numerous sites without my consent. Examples:
https://www.playpico.com/games/play/bubble-pond
http://www.arcadeprehacks.com/game/33214/bubble-pond.html
http://www.yibba.com/games/bubblepond.html?m3
Has anyone else had their games lifted by sites like these? Any suggestions of actions I could take?
Thanks!
Trevor
P.S. Here's the game as hosted here for context:




Hey everybody! Just sharing a little Minesweeper-Clone that I've programmed^^.
New Version:
Mouse is not required anymore, but you can use the Cartridge below if you wanna use the Mouse.
Controls for "Non-Mouse-Version":
- Arrow-Keys to move Cursor.
- Press and release X to open a Tile.
- Press and release O to mark a Tile (red or blue Flag).
- Hold X or O + Arrow-Keys to scroll.
And here the "Mouse-Version" of the Game:
IMPORTANT: Keep in mind that the "Mouse-Version" can be quite unplayable on Browsers. This Version of the Game runs best directly on PC, started by PICO8.


A quick update: now with increasing difficulty levels :)
I discovered PICO-8 on Saturday and was inspired to cobble this together in a couple of hours. The main limitation at the moment is there's only one level - your ship just sits there, all alone, after you've destroyed all the asteroids. I'll finish it off when I get a bit more time but I think it serves as a nice little example of vector-based (rather than sprite-based) graphics.
Gamma Slice is a puzzle game based on cutting the corners of squares containing triangles. The triangles are of four different colors. When they match, they disappear. How many can you clear from the well after 20 cuts?
Controls:
Arrow keys - Position the scissors
O (Z) - Flip the scissors
X (X) - Cut
The scissors will cut along the diagonal of any given square and flip the triangles inside!
Code & Sound: Derek Andrews
Graphics: Jeff Barr
This game was a submission to Nerdery Game Jam 2019.
Updated 5-21-21 to fix a small compatibility issue with updates to PICO-8 particularly where the title screen used btnp then did a while loop on btn waiting for it to stop being nonzero.

Hey everybody! I've been digging in pretty deep to PICO-8 lately, and loving it every time I do. This is my third game created with the engine and I really do enjoy it.
It's called COLORWAYS, a cross between match three games and THREES.
Use the arrow keys to slide pieces around to make matching colors/faces to rack up points.
Enjoy!



If you boot up PICO-8 like this:
./pico8 -home $(cd .; pwd)/data/ |
Then the splore command has a weird bug: Updating the "New" page shows nothing in the "New" page and instead the "Featured" page shows the results that were fetched from the "New" category!

This bug is not present if you boot PICO-8 normally without a custom home dir.
(Also, the above weird $(cd .; pwd) command is the only way I've found that will allow me to make a portable version of PICO-8. Using "." will break the "cd" command in PICO-8 so I have to construct and pass an absolute path. Which is a second bug, perhaps I should open another thread about that.)
-
Trapt (A Dungeon Puzzle Game)
My first game, Enjoy.
Version 1.2
--Includes a remaining health bonus and an optimal steps bonus upon escape
---This will allow you to get up to 3000 extra points added to your score if you complete all 16 levels without one extra step
--Just a reset button, this comes with a price of one life... use wisely
--Official Pico8 button Glyphs instead of "B"
Version 1.3
--Better mechanics for vase collision
--Improved health and score system
--If you have a score 100 and above a restart will result in a loss of 100 points, if you have no points it will result in a loss of 1 life.
Version 1.4
--New start menu, now shows "Items" and "Controls"
--Backpack inventory added, allowing you to collect and strategically utilize items throughout the game
--Lottery system at the end of each level, this allows you to acquire an item if you have available backpack space
--No more "curse", it is a "virus" now
--When infected the whole game will change color
--Items and uses
---1.) Food - Used to gain 1 health
---2.) Vaccine - Used to cure virus
---3.) Med Kit - This is a full heal, it will restore your health to the fullest 16/16, as well as cure a virus (if infected)
--Controls
---Z is your submit button, and it also opens your backpack in game.
---X is a cancel button, and it also will restart your level in game.
---Enter pauses the game and brings up the Pico 8 Menu.
---Arrows will allow you to move your character up, down, left, and right.
Version 1.5
--Rotten food added
--Better vase mechanics and placement
--More accurate lottery pick at the end of level
--Food poisoning added to the game
Version 1.6
--Lighting added thanks to @Remagamer
--Better looking start screen



.jpg)
![]() |
[0x0] |
![]() |
[0x0] |
![]() |
[0x0] |



SQUIBIDI is my entry to the #7DBL jam happening on itch.io where you have to design a game in the same style of Micheal Brough games. In SQUIBIDI, you play as a squid that is trying to escape from the underwater kingdom while every other sea creature is trying to stop you. You can shoot ink in the opposite direction of the movement to kill enemies or change direction or you can drift with the water to recharge your ink capacity.
Controls:
- Arrows: to shoot ink and change direction
- X or Z: to drift with the water current and recharge your ink
Tips:
- Try not to hit anything as ram into object cause 1 damage to you, only do it when necessary (you can kill enemies by doing that)


In a game that I'm working on, I tried to create some 'magic' for my game states by triggering a state change when a global variable is modified:
-- ditto for _update and _init function _draw() cls() local action = { [0] = title_draw, [1] = menu_draw, [2] = marathon_draw, [3] = gameover_draw, } action[game_state]() end -- later, something changes game_state |
What I ran into was what I assume to be scoping issues; variables were present in the game state that shouldn't be, or had stale values, etc. So I'll try to phrase my question in a way that might make sense: How do I cleanly separate game state from the API? I want to avoid massive _init, _update, and _draw functions if possible, so I'm able to focus on one game state at a time.
My apologies if this is a stupid question. I don't have a formal background in programming, so everything I know is self-taught and as a result I don't know the jargon to look for to find my answer.



