Ok So I will be using this thread to document my probably ultra-slow progress into programming.
I will be making a clone of Atari's "Asteroids", all to teach myself to program, and hopefully motivate me to do things....
So far what I am needing to do is:
Make a Title Screen
Make the Ship
Design the Asteroids
the UFO
Add a score board
Lives
maybe a level count?
I have 0 knowledge how to do this so it will be nice to see if I can do it!
I've thought about using sprites for everything game related, like the ship, UFO, and asteroids.... However I've also though about making it like the 2600 asteroids, without a definite sprite sheet and just use it's basic syntax to draw these things.
any tips would be very helpful as well! I look forward to making something we can all enjoy...hopefully!





I'd like to share my first PICO-8 project. It's a puzzle game of my own design. You need to restore the puzzle by swapping pairs of tiles. The difficulty is that not all tiles can be swapped. It's up to you to discover which tiles can be swapped. Figuring this out is only the first step. The real challenge has then only just begun!
v0.2 After solving the puzzle (within a reasonable amount of moves) you now get a solve key, which grants you entry into the game's Hall of Fame. Capture it. You can reply to this thread with the screen capture. The keys are unique, so don't "re-use" the key of someone else. Furthermore, you really need to solve the puzzle. You cannot cheat by inspecting the source code either.



So my Chip came in yesterday, and it's awesome. I've owned Pico-8 on PC/Mac forever but never did anything beyond playing games.
I've done a little pong type tutorial thing and am thinking about doing a small easy game to teach myself stuff about Programming.
My knowledge is about 0 sooo there's that haha...
I think I'm going to start with an asteroids clone to see if it's easy enough for me to understand things like data arrays and tables, also because I love asteroids :D
wish me luck!
(Also if this isn't the right forum area please move it, I had no idea where this post belongs)

In case your game gets slow, it's always helpful to identify the parts of code that take up too much time to compute. This is how you can measure execution time:
local start = stat(1) -- .... do some intensive stuff .... printh("this took "..((stat(1)-start)*100).."% of a frame") |
Hope it helps, and thanks to @Felice for pointing out how to accomplish this.
sulai
I've been working on my first Raycaster and I ran into a problem I can't seem to fix.
I think it has to do with the CAMX variable, and the Ray Hit section of the code (Specifically CAMX's implementation in the RDIRX and RDIRY values).
Depending on the direction I'm facing I get lines that go straight through everything (With virtually no line-height).
I've also noticed that this bug tends to only happen in the reverse SIDE as the wall it's supposed to hit,
Front wall (SIDE 0) has a line that has the color of a SIDE 1 wall.
Here is how it looks:
Here's the code:



So i read the manual, watched the tutorials and also looked at the [keys] section under https://neko250.github.io/pico8-api/.
Problem is that i cannot find basic keyboard inputs, let's take the waveform editor. You click a note. You accidently click too high or too low, so you have to precisely align between the other notes before you can 'fix' it, and that requires carefully not moving right or left (or else it will affect the other notes).
I use a high dpi mouse on a pro gaming surface and i slowed down my cursor, still is tricky. Aren't they controls like Shift+Up to go higher tone, or anything of that nature?
Note: the same is true for most editors includied in Pico. In order to be productive we need to have more shortcuts.... or am i missing something?
== UPDATE ===
Making matters even worse, some shortcuts do not even work at all. Speed using < or > ? yeah right. Not a mac osx .
== UPDATE2 ===
Reading through the manuals and forums, the absense of < >, snap to Cm pentatonic but more important the complete absence of 'backspace' (and therefore the ability to delete notes)[b]


Slime Bubble Bro is a fast action platformer arcade game.
Objective:
You are the Slime Bubble Bro and your mission is to save Slimette from the evil clutches of the Skeleton Gang and their minions!
Instructions:
- <x> to jump, <z> to shoot
- Bubble up your enemies until they explode
- Push bubbles around to chain their explosions and get more points
- Bosses can't be bubbled, but you can use their minions to do more damage










Hey guys,
I'm new to Pico-8, and I love the general concept of this! I'm already in the middle of some cool development.. and hit all the borders: compressed code size exceeded, out of memory in the late game, and generally high cpu load in the late game.
For memory profiling, I use a function to recursively count the elements in a table. This is good enough for that task.
The question is how to do cpu profiling in pico-8? The goal is to identify the parts of the code, which use up most cpu time. Something like this would be sufficient for me:
function oh_this_might_take_long() local start = time() -- .... do some intensive stuff .... printh("this took "..(time()-start).." seconds") end |
However, this would not work out very well, because time() is too inaccurate. It increments in steps of 0.03335. This is the duration of one frame (1s/30f = 0.03335 s/f), so time() does not help with this.
Any ideas on how to do cpu profiling on pico-8?
thanks,
sulai


You can use this function in your program to do some basic memory profiling. Given the limit of 1MB memory for Lua variables, a little profiling will be much needed for many of us ;) It will return the amount of all elements of a table, including the content of sub tables.
It will not show the actual amount of bytes used, would be interesting if there is a way to calculate that? But you can use this as a rough estimation and check if your optimizations show any effect on the table size.
table={} function table.size(t) local size=0 for k,v in pairs(t) do size+=1 if type(v)=="table" then size+=table.size(v) end end return size end |

Description:
A classic-inspired jump'n gun with:
- nonlinear level layout
- a good number of enemy types
- a few bosses
- a couple of (not-so) secrets
- a cheesy story
Controls:
- Left/Right: move
- Z shoot
- X jump
- Up: something something
Details:
The game is rather short, meant to be experienced in Normal or Hard difficulties, but I've included an Easy mode with unlimited hitpoints to allow anybody to finish it by brute force (you'll even get the good ending when finishing the game this way, but you'll feel cheap inside :)
Progress is saved as long as the cartridge is not reset/reloaded so if you collect an item or kill a boss, you won't need to do it again, despite restarting the game at the beginning.
This is my first Pico8 cartridge, and probably last. It started as the Ghosts'n Goblins homage I've always wanted to make, but turned into something else as I started to deal with map/sprite size limits. I had a lot of fun making it, especially the art, but the strict limits on tokens and code size made the lazy programmer in me cry :-}
Tips:
- Enemies are deterministic and follow simple patterns, try to learn them.
- Bosses are only vulnerable in the head.
- After killing the first boss at the Cathedral entrance, you have to go back to the Cemetery and cross the open door below where you started.
- You can break some ground blocks (the brown ones with yellow dots) by shooting them.
- You need to get the 4 orbs to summon the second boss.
Changelog:
v0.999rc
- Fixed bridge area (player could get stuck in Easy)
- Fixed non-looping music
v0.99rc
- Added music during gameplay
v0.99
- Various collision detection fixes
v0.93 (Hall'o'ween)
- Halloween sprites
- Rebalanced small details to account for player feedback
v0.92:
- Repositioned enemies
- Made first backtrack/shortcut more obvious
v0.91:
- Fixed item lost after respawn
- Added visual hint to second/third screens
Known bugs:
- You can get stuck in walls at screen transitions when jumping (move backwards to get unstuck)
- Quite rare missed collisions with ground







Here's my PICO-8 tribute to my favourite end-of-game music, "Still Alive" from Portal.
I also replaced the original credits with some shout-outs to the PICO-8 community! ;o)
Hope you like it and don't forget: the cake is a lie!
(P.S. - The original game music was done by Jonathan Coulton)
References used:










-- converts anything to string, even nested tables function tostring(any) if type(any)=="function" then return "function" end if any==nil then return "nil" end if type(any)=="string" then return any end if type(any)=="boolean" then if any then return "true" end return "false" end if type(any)=="table" then local str = "{ " for k,v in pairs(any) do str=str..tostring(k).."->"..tostring(v).." " end return str.."}" end if type(any)=="number" then return ""..any end return "unkown" -- should never show end |
Example usage:
> print(""..tostring({true,x=7,{"nest"}})) { 1->true 2->{ 1->nest } x->7 } |





I'm trying to do some table trickery with the __newindex()
metamethod, but I can't actually create a new entry in the table from inside of it unless I nil-ify the __newindex
key first, because it'll just recurse back into it when I try to set something.
Supposedly, we're meant to use rawset(t,k,v)
to create keys safely while inside there, but we don't have access to that on pico.
@zep, is there any chance you could give us access to rawset()
in the next version, so I can do this properly? Setting the metamethod to nil and then restoring it just feels horribly inefficient and klunky, since it triples the work needed when I first set vec.x=123. I hope this is just an oversight in the list of exported Lua features.
Edit: Apparently there's a rawget()
too. I should probably ask for that as well.
Please? :)
PS: Also, since I'm being all greedy anyway, next()
would be nice too. ;) But not as important.

Hi, so I bought a pocketchip just to run pico8 and i was a bit disapointed that it doesn't run near as well as i expected (stutters, slows down, etc).
Are you guys aware of something else? I love the concept of the arduboy which dedicates 100% of its very limited resources to the game it runs. I'd love something like that but for the pico8, or at least as close as possible (maybe a super light distro that boots straight in pico8 with all 'extras' removed?
Thank you.








