A slow but token-efficient sort:
-- 35-token bubblesort, by pancelor function sort(arr) for i=1,#arr do for j=i,#arr do if arr[j] < arr[i] then add(arr,deli(arr,j),i) --slow swap end end end end |
I did a brief speed analysis and this function seems reasonable to use for arrays up to around 50 or 100 elements, depending on how much CPU you have available to burn.
speed analysis:
[hidden]
I did some minimal testing, using this code:
cls() function _draw() arr={ --20,5,8,3,7,4,1,9,2,-30, --20,5,8,3,7,4,1,9,2,-30, --20,5,8,3,7,4,1,9,2,-30, --20,5,8,3,7,4,1,9,2,-30, 20,5,8,3,7,4,1,9,2,-30, } sort(arr) end |
By commenting out lines of the array, I changed it's length. Here's how much CPU the function spent, as a percentage of a single 30fps frame (measured with the ctrl-p monitor, on pico8 0.2.5g)
The "best case cpu" was calculated by defining arr
outside of _draw
, so that the array was already sorted after the first frame
Array length | Typical cpu (30fps) | Best case cpu (30fps) |
---|---|---|
10 | 0% | 0% |
20 | 1% | 1% |
50 | 5% | 4% |
100 | 21% | 15% |
200 | 81% | 58% |
300 | 181% | 130% |
400 | 321% | 231% |
I believe this algorithm is O(n^3): O(n^2) for the two loops, and an additional O(n) b/c the swap step uses add
and deli
, which shift around the array elements. But the chart seems to indicate that doubling the length will quadruple the cpu cost (instead of octupling it) so maybe it's only O(n^2) somehow? It doesn't much matter, since you don't want to use this for large arrays anyway, but maybe add/deli are cheaper than I would expect.
Hello world!
I'd like to share my first game and first post here with the Pico 8 community. Neon Saucer is a vertically scrolling endless runner where you pilot a color-switching UFO up through Neon City. Match your color with gems to collect them, match your color with enemies to smash them. As you get higher, your ship goes faster, and you'll need to deal with trickier enemies and obstacles.
In short: Move fast and break stuff.
Postgame scoring is tracked for total height, total gems, successful enemy hits, and best banked combo. A combo of consecutive enemy smashes builds beneath your ship. The bottom of the screen shows the combo timer which is refilled with each successful enemy hit or gem pickup. A combo is lost if you hit a non-matching gem or the sides of the screen. A combo is completed once the timer runs out, or the player slows down. Completed combos award bonus gems for the amount of the combo, plus additional bonuses for every 10.
When you move the mouse cursor in the Sprite Editor the status bar at the bottom shows the X and Y coordinate in the spritesheet. It would be a help if this also showed the Width and Height of a selection if you have something selected. I often want to measure the size of things in the sprite sheet and the selection tool is usually the way to do it in other programs.
tiny farm has an itch now if you want the exe:)
https://lumpycamel123.itch.io/tiny-farm
for my final game in the lumpy games tiny games pack i made a little farming simulator. i would consider it to be pretty feature extensive as you can farm ranch fish and mine your way through my tiny little world.
also it has fully featured co-op
how to play--
you can open the shop by pressing x on the froggys(frobert and frebeca) to buy seeds, sell crops, buy animals, sell goods, turn bars into ore, buy harvest multipliers, and buy tool upgrades by switching menus with the right and left buttons with after pressing on a froggy, it doesnt matter which you press on. to tend to your crops you have to till and water the ground to plant seeds then water them each day for them to grow. when theyre grown you can harvest and sell them to frebeca. when you have animals theyll start out as babies and you have to feed them for 2 days until you can start to get artisan goods from them when you feed them. fishing is always available for some quick cash in case you need a bit more money to fill up your crop space or something. when you have 4 iron or gold ore from mining the rocks on the bottom of the screen you can combine them with some money in the second to last shop menu to get bars and upgrade your tools on the next menu. you can also sell them if you want or if your tools are maxed out. on the menu where you get bars you can also spend 500$ to upgrade your multipliers on crop, animal, fish, and mining output. i was thinking 1000$ might be better so let me know. i hope you have fun:)
here for game 2 in the lumpy tiny games pack we have a little f1 simulation i made for my wife because shes really into racing and i think its cute tbh. you can change your cars color by pressing x/o and you control it with the arrow keys. thats all there is to it really its just a tiny little game with 8 tracks i drew based on real life f1 tracks. i thought it was really fun so i hope you enjoy:)
now with an itch page for the exe
https://lumpycamel123.itch.io/tiny-balls-space-pool
patch 1.1 - added endless modes for ultimate, pool, co-op ultimate, and co-op pool! when you have less than 8 balls left 8 more will spawn leaving you with the original 15 and also it swaps between the team colors for prettiness:)
patch 1.2 - ball trails added as well as the balls wrap around the screen now to make the last parts of time modes less boring/frustrating. you can also swap to the pico 8 second palette if you press o on the main menu too:)
ive finished the full version of my first game spaceballs, going with the theme of my lumpy tiny game pack i want
to call it tiny balls lol. in this version theres 2 new vs modes where you can play a classic turn based
version of pool with a friend or space hockey! it still has the original ultimate, space pool and co op modes but i just wanted to squeeze more into it until i reached the token limit. i thought it was a lot of fun so i hope you enjoy:)
patch 1.3 - tweaked particles and physics to make things less chaotic and more enjoyable
final version 1.4 - you can toggle wall collision in real time in the pause menu:)
Press 'Z' or 'X' to toggle the mouse cursor when playing on a desktop.
Hershey's Train Line is a present for my son, Hershel, for his 3rd birthday. Draw a path around the obstacles to get the train from one side of the screen to the other!
At any intersection, the train always follows a straight path when possible. When faced with a T intersection, the train always turns left.
If you've got any young people in your family that are as into trains as my son is, I hope this makes them smile!
The BGM of the traffic information "BayFM Traffic Updates" on BayFM, Chiba, Japan.
BayFM
https://www.bayfm.co.jp/
Updated cart with menus and the ability to continue from the last level you got to, plus a more complete tutorial:
I have added an interactive tutorial since I noticed first time players couldn't figure out what the aim was, or how to do stuff. Press the o button to access it.
I'm hoping I ironed most of the bugs out of it, please let me know if you find any
Dimensional Jump
This is the second game I've worked on, but I couldn't have done it without the support of everyone who helped, scroll down or check out the credits at the end. Much of the development was streamed Live on Twitch.
Before we get into the gameplay, I wanted ask if you'd consider supporting this game so we can make more games in the future. https://abemassry.itch.io/dimensional-jump
Now that that's out of the way, let's begin.
A journey through the dimensions from dimension zero to the third dimension.
Level 0
Hi! This is the first game I've made. It's a short, difficult, and very forgiving platformer in which I tried to use gliding in as many interesting ways as I could. Hope you enjoy! (Note: This game was intended to be played with checkpoints turned on. I am not responsible if you turn them off for your first playthrough and suffer.)
Music by Mendica - https://www.youtube.com/@mendica
My Pico-8 game based on the 1982 Irem/Williams arcade game.
How to Play
Clear the course by jumping or shooting the obstacles.
Thanks To
- Finn for testing
- Music thanks to notehead (@noteheadmusic)
Version History
0.81 - 17-Apr-2023 - Released
0.82 - 06-May-2023 - Fixed crash if particles had physics at end of level
Yo @zep,
By default, split(str)
has a go at each split element to see if it's possibly a number, presumably using tonum(elem)
. You can disable this with split(str, false)
or split(str, delim_or_width, false)
.
Unfortunately, unlike tonum(str, 1)
, you can't hint the format of the number, like I could by saying tonum("fe", 1)
to get 254 aka 0xfe. I tried replacing the split()
boolean arg with a number, but it didn't seem to get passed through.
I don't know if you're actually using tonum()
inside split()
, so maybe I'm assuming too much, but if you are, could you just pass any numeric conversion flag direct to it? That'd let us convert hex directly to numbers with something like split("baadf00d", 4, 1)
returning {-17747,-483}.
αίμα: "blood"
matrix: an array of numbers in two dimensions
Leech life and numerological signs from the mortals of Batavia to rebuild your dominion. Feed the eternal bleeding cross, but don't let your greed outstrip your curiosity, lest the Master return from his grave.
(It's 2048 with vampires, plus a "match tiles to see people walk across the screen" mechanic inspired by the old flash game Jericho. An unusual amount of thought went into the interaction design of this one, similar to the slot machine-like parts of my earlier carts.)
Thanks to skdaffle for drawing the one big image in the game!