I need help with this code

I am working on a game that uses Cellular Automata to make cave interiors. I’m having trouble with updating the tiles so they flow like liquids. The update goes one step into the algorithm and then stops. I think the problem is happening somewhere in the function “update dungeon (previousImage).” Can someone help? Here is the game: https://makecode.com/_g0yAzu0c1447

3 Likes

this is really impressive, well done


in the debug screen it seems that the update function runs fine so the problem lies somwhere in the function itself
btw there is a bug with this
image
when selcting thick caves as i don’t think you’ve defined whichSprite

Hey, thanks for pointing that out. I went back and fixed that bug. thank you!

1 Like

I figured out the problem

I forgot to reset X and Y, and so the code was inputting pixels after 100.

1 Like