I've been rebuilding/refactoring a recent game in efforts to reduce clutter and increase performance, as well as get under the dreaded compression limit.
For whatever reason, I've started to nest functions...mostly as a way to better organize code. This works just fine but I'm wondering if there's any real downside to it?
I've been nesting functions that are relative only to code of the parent function, so as to reduce some code. Usually some math or condition checking or something...
As of yet, it doesn't seem to impact on my games at all. Just wondering...
function myParent() function myNested() ...often repeated task code... end if Something then myNested() end if Something and SomethingElse then myNested() end ...you get the idea... end myParent() |


It's an engine, inspired by Noodle Engine, but made for working with surfaces.
It is really easy and fun to use, even my pizza generator 19 lines long :D
I hope you will enjoy it! I don't see a reason to make it closed source, so... Enjoy the source also!
Here is how to use it:
surface("pizza",function() -- your code goes here end) |
That's it!
Here is available API:
- s_mode(m) m - one of [ "add", "sub", "over", "norm" ]; sets how new points will be drawn (height added, overridden and so on)
- s_point(x,y,z,c) (x,y,z) - position, c - color; draws a point
*s_line(x0,y0,z0,x1,y1,z1,c) (x0,y0,z0) - point a, (x1,y1,z1) - point b, c - color; draws a line from point a to point b




Lil' Satan's Cake Quest is an old-school 2D platformer game.
Objective: Storm the enemy's castle to eat lots of cake!
Instructions:
- Transform your enemies into cake with your electric beams (z button)
- Eat cake to gain back lost health
- Maximize you health and beam power by eating golden cakes dropped by [b]demons










This twitter thread was getting out of hand, so I wanted a place to store some of the carts for later reference. Move along, nothing to see here :3
here's a wip of another take on my tetramino-making mechanic (T-Factory 1)
hopefully a little more appealing / a little less awkward (?)


Hello,
This a completely new TOWLR, made with the pico-8 engine, based on the ideas from http://towlr.ludumdare.com/
How many failed attempts have you made before finding the solution?
"What are Towlr?
Towlr are puzzles. Contrary to conventional design wisdom, the towlr games come without instruction and without explanation. Your job is to discover their secret, and score deliciousness. Yes, every Towlr game can be completed.
Towlr are complete audio/visual experiences. They should be played with sound at a reasonable level, and computer monitors turned on.
Towlr may frustrate you. This is normal."


I'm currently working on an improved version of P.Craft (save system, a boss, a few new items ...) by using the multi-cartridge system. So I have a menu cart, a main cart and some others, and I switch between them with load() or cstore() a cart and use reload() to get it's data from another cart. It's a pretty great system to go beyond the usual limitations of Pico 8, while still having some constraints.
I noticed a major issue once exported in HTML : the carts are kept in the browser cache or local storage and aren't updated when I make a new export.
So if I change one of the cart I export (except the starting cart), the changes are not visible in Chrome, my usual browser (because I already viewed an older version), but are in Firefox, my secondary browser (because it's the first time I'm opening the file).
I tried changing the exported .html filename, changing the cartdata() name or various javascript tricks, but none of that worked.
The only way I found right now is to change the names of each carts I export, and then it works correctly. The browser is forced to get the new version, as he doesnt find the carts in his cache/local storage.
Has someone already noticed that issue, and is there another work around ?
Also secondary question, is there a way to post a multi-cartridge game on the BBS properly for it to work in the browser and splore ? I suppose I could post each cart separately and people would have to download all of them for it to work. I could maybe test if the cart system is working or not, and display a useful error message explaining that it will only work if you download all the carts.





Hey! I’m a 19 years old French student in electronic and computer engineering. I discovered Pico-8 with the PocketCHIP, but it’s only now that I did something with it, so here it is: my first Pico-8 game! I hope you’ll like it!
This game is called Dalek and is a remake of the original Macintosh game “Daleks” that I played a lot when I was a kid.
Overall, making this game was really fun, I did struggle a bit with the animation system and at the end my code got ugly but hey, I made this game ONLY on a PocketCHIP. I don’t recommend you do the same, it’s awful, seeing only a dozen lines of code at once makes it hard to remember how you put everything together.
Feel free to comment and give me suggestions!
Instructions
You must kill all the Daleks before they kill you.
You kill the Daleks by making them collide with each other or by using your hammer which kills all nearby Daleks (you only have one hammer per level).
If you get stuck (and you will), you can teleport randomly on the map. Be careful! You can land next to a Dalek and that could kill you, there’s a little bit of luck involved here.
Controls
- Press arrow keys to move the cursor.
- Press O (Z/N/C on the keyboard) to move to the cursor’s position.
- Press X (X/M/V on keyboards) once to teleport.
- Hold X to use your hammer (once per level).




Goal
You have 12 days to create gold from what you can find in the woods
Each day you will be able to work in one place. You can leave it anytime to go to next day.
Places
Shelter : This is your house when you can brew some potion and unload or load stuff from your wagon.
Forest : A good place to gather basic ingredients in your wagon.
Market: Here you can serve food to earn money or buy new recipes and items.
Controls
<arrow keys> : move around. ( leave screen to skip to next day )
<w> : activate objects
<x> : cancel action
Transmutation order











Cleaning up my attempt at the "Shooter in Pico-8" tutorial. Now has a title screen that alternates between a few attract screens before returning to menu, And much smoother ship movement and firing.. Perhaps TOO smooth. I seem to shoot like.. A bajillion bullets per keypress. XD
The music is crappy, But it's just placeholder stuff till I can write or make something better.
If anyone has an idea how I can trim down the bullets/Firing SFX to a more believable rate of fire, I'm all ears!





EDIT: updated demo to include huge optimizations contributed by Felice and ultrabrite in the thread below.
After reading this fascinating article about the Minsky Circle, I started experimenting with the algorithm in Pico-8. In the process, I stumbled upon a method for rasterizing circles that seems to be faster than the native circ() and circfill() functions at larger sizes, and also has a more pleasing look that minimizes low-resolution aliasing.
Demo attached in case anyone finds this useful. Press Z (or whatever key you've bound to button 1) to toggle between the Minsky Circle-based methods and the native Pico-8 draw functions.
--by @musurca and @Felice function minskycirc(x,y,r,c) x,y=x+0.5,y+0.5 local j,k,rat=r,0,1/r poke(0x5f25,c) --set color for i=1,0.785*r do k-=rat*j j+=rat*k pset(x+j,y+k) pset(x+j,y-k) pset(x-j,y+k) pset(x-j,y-k) pset(x+k,y+j) pset(x+k,y-j) pset(x-k,y+j) pset(x-k,y-j) end pset(x,y-r) pset(x,y+r) pset(x-r,y) pset(x+r,y) end -- @musurca, @Felice, and @ultrabrite function minskycircfill(x,y,r,c) x,y=x+0.5,y+0.5 local j,k,rat=r,0,1/r poke(0x5f25,c) --set color for i=1,r*0.786 do k-=rat*j j+=rat*k rectfill(x+j,y+k,x+j,y-k) rectfill(x-j,y+k,x-j,y-k) rectfill(x-k,y-j,x-k,y+j) rectfill(x+k,y-j,x+k,y+j) end rectfill(x,y-r,x,y+r) end |





I'm new to Pico-8 and this is my first snippet. I would appreciate any feedback, or ways of making this more efficient.
It's a snippet to draw a sprite in an area as a repeating pattern texture.
function drawpattern(idx, x0, y0, x1, y1) local sprx = 8 * (idx % 16) local spry = 8 * flr(idx/16) for y=y0,y1,8 do local endy = min(y1, y+8) local sampleh = endy-y for x=x0,x1,8 do local endx = min(x1, x+8) local samplew = endx-x sspr(sprx, spry, samplew, sampleh, x, y, samplew, sampleh) end end end |
Update to fix issue with save data.
This is my first game ever. Is it the greatest game you've ever seen? That depends on whether or not you've seen another game.
Here are some things critics are saying about games:
"...has all the things the original video game did not..." - NY Daily Times
"...the opening sequence is Halo-level epic..." - trustedreview.com
"...a polished, well-designed RPG, and through its phenomenal mechanics, astounding art, sound design and fantastic writing, it is sure to revolutionize the modern RPG genre." - Windows Central
"...For the first time ever, I truly felt like I was in space..." - COGConnected
I don't think I've missed it anywhere, checked the values on the appropriate (and all other) stat values, etc. There doesn't seem to be a way to get the mouse wheel. This'd be awfully useful in a tool I'm writing. I'm bummed that I have to turn to the dpad/cursor keys while otherwise mousing around in my little gui.
@zep - Assuming I'm not just missing it, would you mind adding the mouse wheel as another stat? Just treat it like an axis; that seems to work better than blipping buttons, in my experience with other APIs. Just increase or decrease the stat value by one each time you get the scroll event.
Please and thanks? :)




