picoforth - a stack-based programming language
picoforth is a project I started working on a while ago, and then gave up on, then returned to yesterday. It is unfinished (there are a few minor bugs, there is essentially no support for strings yet, and the method of inputting text is pretty bad), but still can do quite a lot.
If you are unfamiliar with stack-based languages, I recommend you check out easyforth, a stack-based language resembling a typical Forth. It can teach you the basics of stack-based languages, and to a lesser extent, Forth.
Here's the list of the words (for those unfamiliar, a "word" in forth is roughly comparable to a function in most other languages) currently in picoforth:
Not sure how a specific thing works in the game? Check the one-page PDF manual!
You signed up for the biggest martial-arts challenge in history! In a gauntlet beyond example, contestants from all around the world face myriads of artificial monstrosities to find out who can deal with them performing the most stylish and efficient combos. There’s a twist though - you can only move in accordance with the hand of cards you’re holding. Ah, there’s nothing like the beautiful arbitrariness of game rules...
Features:
- Exceptional replayability: No two playthroughs will be alike thanks to randomly generated arenas, monster spawns and a shuffled deck of movement cards!
Hey @zep,
I'm not sure if this is related to the last += parser bug. It doesn't seem to be, but if it is, it's possible you already fixed it in your dev version.
Having a tab as whitespace in this construct:
t={1} t[1] +=1 -- (with visible whitespace) t={1} t[1]⟼+=1 |
Produces an "unexpected symbol near +" error.
I copied the "see what the pre-parser does" trick to clipboard:
printh([=[t[1] +=1]=], "@clip") |
And got this when I pasted it back into an editor
t[1 ] = + (1) -- (with visible whitespace) t[1·]⟼·=·⟼·+·(1)·· |
Note that it only seems to do this if the left value is a table deref. Mind you, other complex lvalue patterns might also trigger it.
Maybe your regex needs some "\s*" patterns where it currently only has " *"?
I'll assume this is enough for you to go on. :)
Hello everyone,
I was recently working on a project and wanted to implement an infinite/looping horizontal scrolling system, similar to that of games like Sega's Fantasy Zone. (footage here: https://www.youtube.com/watch?v=L7WQYjC26SU) For those unfamiliar, in this game, if you scroll far enough in either direction horizontally, you'll loop back around to the start of the stage, seamlessly. I did sort of get it to work, by constantly drawing the map according to a set variable, rather than a fixed point, and setting it so if the player passes too far in either direction it resets to the start of either end. however it's very choppy and no less, doesn't really accommodate something like the camera system that game has, or at least I don't think it does.
I'm rather new to working with the Pico-8/coding in general, so I'm sorry if this is a bit of a bad question to ask/if you have any advice please do let me know. Likewise, thanks for reading this far into this post.
Controls:
Arrow keys to move
X to retry
Possession:
There are three types of possession:
x lock possession where the afflicted player is movable only on the x axis
y lock possession where the afflicted player is movable only on the y axis
mirror possession where the afflicted player mirrors the other player's moves tex: Up become down, right becomes left
Death:
Both players being possessed
And instability which is when the two player aren't at the same relative location in there respective
boxes, but this alone doesn't kill you only after five moves will you die
Note(Becoming possessed resets your unstable moves before dying)
"What if you're right and they're wrong?"
A tweetcart (276 characters) you can actually play!
m,x,y=128,43,0e,s=x,y::::cls()rect(30,-1,96,m,6)for i=-m,m,32do line(64,i+y/2,64,i+y/2+14)end
if(btn()==1)x=43
if(btn()==2)x=78
print("웃",x,86,11)if(y>m)then
y=0s+=1e=rnd()>.5and 43or 78end
print("🐱",e,y,8)y+=7print(s,84,116,10)if(y==91)and(e==x)then stop()end flip()goto
Made in homage to the old single-game LCD handhelds that had you dodge oncoming traffic with your racing car.
Twitter: Ludokultur
Is there any way of editing the spritesheet at runtime so that I can use the spritesheet as the save location for a game?
The game consists of a 32x32 grid but each grid can have many states so figured I could store that as binary, but that doesn't really work well with the cart data limitations. So I figured if I can store the information to the spritesheet, I'm just utilising the memory available there but I cant seem to find much documentation on the matter. I know there is sget/sset but when I used that the screen had alternating colour lines appear... (I think I was putting it on the lower half of the spritesheet if that might be part of the issue?)
Maybe a text file would be better?
Hello, everyone!
I am very new to this and not a good programmer in general (language comes much more naturally to me than maths) so I need your help. I'm making my first PICO-8 game. It's a WWII submarine simulation game where you have a top-down view of your sub. You can dive (which just hides the boat) and fire torpedoes. I have most of the graphics done. What I need your help with is this:
How do I rotate the game world around my boat and keep track of enemy ships I spawn? The game world itself is empty (it's just the blue ocean). But I want to spawn in ships randomly off screen and then have them move slowly across the game world. And I want my boat to be able to turn around slowly with the camera locked to the boat. I've decided the boat will just move at a fixed pace so all the turning is doing is changing the view of the world (which is what you see on screen). I might actually just fake movement of the player boat by moving the enemy ships in a relative direction accordingly.
Let's assume the boat isn't moving. I can tackle that later, when I have this other stuff in place. How do I define a section of ocean a few screens wide in all directions and then spawn enemies there? And how do I rotate the view around the sub (including the enemy sprites) and then keep track of their position relative to the rotating camera?
Play with sandpiles, mathematical constructs that have simple rules and odd properties.
Use a brush to pour sand on, or go by singular grains. Flatten to any height with the brush or using the menu. Swap out colors with the built-in palette.
Options:
❎: to brush
🅾️: to palette
arrows: select options
Brush:
❎: paint
🅾️: back
arrows: move brush
Palette:
❎: switch theme
🅾️: to options
arrows: select options
Feedback appreciated!
inspired by Numberphile