This Pico 8 cart projects a square in 3D space onto the screen. Click here to give it a try.
Stuff about Pico 8
I made a Pico 8 cart which produces a SNES Mode 7 style floor. The trick is in the function tline, which draws a line between two points, sampling from the map data along the way. You give it the map position to start from, as well as dx and dy values it should use as an increment after each pixel. The other main thing is setting a depth value per scanline, the closer to the bottom of the screen the nearer to the player’s view. The rest is just trigonometry, applying angles to vectors using sin and cos.
I’ve been playing around with Pico 8, making small games and experimenting to amuse myself. It’s a lovely little program which they call a “fantasy console”. This means the games for it look quite similar to something like the Game Boy Advance, they are low resolution, with low fidelity sound and are generally quite compact experiences. It’s actually a program which you run on your computer, with a full development environment built in. It includes a code editor, a sprite designer, a map layout tool as well as sound and music creation tools. Each one is very constrained, but in a way that makes it interesting to use. It forces you to not overcomplicate things. You have to focus on the core idea.