This is a maze generator in 191 characters.
t={-2,2}function g(x,y)if(pget(x,y)<7)return line(x,y)::l::r=rnd(t)if(rnd(2)>1)then g(x+r,y)else g(x,y+r)end line(x,y)if(rnd(99)>1)goto l end cls(7)g(0,0)pal(7,8,1)pal(6,7,1)::_::flip()goto _ |
This is my first time doing this, let me know if it could be improved.
This is a simple transition, that should be fairly easy to use. All the code is in rgb_transition.lua. Simply call rgb_transition_setup()
when starting the transition, and then on each frame, after the game is drawn, call rgb_transition()
. It takes one argument: Whether the transition should be fading in or out. True fades out. In this test cart, press X to reverse the transition.
This is mainly a tech demo for a 3d engine with a depth buffer. This is not finished, but I wanted to share it.
TODO:
- Optimisations maybe?
- BSP - currently model faces aren't sorted, so concave models will work weirdly. The depth buffer is only for interactions between models.
- Maybe lower the resolution for better performance?
- Some sort of culling?
- Better use of depth buffer resolution, make it more linear maybe?
(The depth buffer works with the use of colour tables, in a few passes. If anyone wants more detail, I can provide it.)
Oh yeah, controls:
WASD: Move
QE: Up/Down (relative to look dir)
Arrows: Rotate camera
Z/C: Toggle depth rendering
Thanks @freds72 and @Maeve for advice on the memory issue, I hope it's gone once and for all! (Memory still rises rapidly, so I'll look into what could be causing that too)
I've encountered a bug where vectors and f64 userdata doesn't get saved in the pod format.
This code:
local foo = vec(10, 10) print(tostr(foo), 10, 10, 7) print(pod(foo), 10, 20, 7) print(tostr(unpod(pod(foo))), 10, 30, 7) local bar = userdata("f64", 2) bar.x = 10 bar.y = 10 print(tostr(bar), 10, 50, 7) print(pod(bar), 10, 60, 7) print(tostr(unpod(pod(bar))), 10, 70, 7) |
prints:
(10.00000, 10.00000) userdata("f64",2,"") (0.00000, 0.00000) (10.00000, 10.00000) userdata("f64",2,"") (0.00000, 0.00000) |
You can see that pod() doesn't save the values for the userdata.
Hello. I was playing around with pods, and I noticed that create_diff isn't defined. here's the code (I'm 99% sure I didn't do something really stupid):
local a = {"a", "b", "c"} local b = {"a", "c", "d"} local pa = pod(a) print(pa) local pb = pod(b) print(pb) local pd = create_diff(pa, pb) print(pd) |
@zep was the function removed? it's in https://www.lexaloffle.com/dl/docs/picotron_pod.html#POD_Diffs, but maybe that's outdated.
EDIT: Never mind, it's called create_delta!
Here is Conway's Game of Life in Picotron, using the colour tables as a fast way to count all the pixels at once.
This version does not work in the web player, because input is not detected ( @zep pls fix!)
Controls:
Up: Increase simulation speed
Down: Decrease simulation speed
Space: Pause
F: Step one frame
C: Clear screen
R: Randomise screen
L-Click: Draw pixels
R-Click: Erase Pixels
L: Toggle large cursor
Basic code: