cursed_petri

Published 2023-06-12


I stumbled upon this very odd behaviour while making this tweetcart :
https://www.lexaloffle.com/bbs/?tid=39326

After loosing some sleep over why a pixel than can randomly go in any of the 4 direction always build staircases, here is what the poor souls of the #help channel on the pico8 discord server and I have found out :

I wrote this :

dx=rnd({-1,1}) dy=0
-- %50 chance to swap them
if(rnd({true,false})) then dy=dx dx=0 end

The behaviour disappears if I use any other method of achieving this result

So, if anyone can explain why this behaviour happens, I'd be very grateful!