let function F(z) srand(z) return rnd()<0.1 end. we don’t particularly know (or care) which specific integers F(z) is true for, but for any given ‘a’, ‘e’, and z=flr(a*99+e) where F(z) is true, then increasing ‘e’ slightly and decreasing ‘a’ slightly will still give the same value z as before, so F(z) is still true.
and in the context of this cart, ‘e’ increases over time, and x decreases as ‘a’ decreases, so the x-values that clouds are drawn at move left over time. cool!
← Return to game
Comments
Log in with itch.io to leave a comment.
In 560 bytes? It’s ridiculously awesome, even with a lot more bytes 😁 I really like the minimalist look!
WOW this looks incredible, and fun to play!
how do the clouds work?? I can see that it boils down to this:
, and if I comment out the srand it behaves how I’d expect, but I don’t understand how seeding the RNG this way makes the clouds visually coherent
aha! I figured it out:
let
function F(z) srand(z) return rnd()<0.1 end
. we don’t particularly know (or care) which specific integers F(z) is true for, but for any given ‘a’, ‘e’, andz=flr(a*99+e)
where F(z) is true, then increasing ‘e’ slightly and decreasing ‘a’ slightly will still give the same value z as before, so F(z) is still true.and in the context of this cart, ‘e’ increases over time, and x decreases as ‘a’ decreases, so the x-values that clouds are drawn at move left over time. cool!
Yup you got it exactly! The same trick is used the generate & move the obstacles!