I'll add the download key thingy once it uploads.
Also as dumb as it sounds, the stone is the first layer, and the dirt is underneath it. I'm trying to make a semi-random terrain piece the size of the screen, and basically I'm trying to figure out how close the stone is to the bottom, then running a second FOR loop to place DIRT until it reaches the bottom, aka fills the screen.
STONE=0 'x coord of the stone STONEH=10 'height/y coord of the stone DIRTH=10 SKIP=1 `to skip the loop if the STONEH value is too high (otherwise the dirt will be placed off screen and result in an error) FOR I=0 to 24 `24 is the length of the screen BG wise SKIP=0 IF STONE >14 THEN STONEH=14 BGPUT 0,STONE,STONEH,2 INC STONE,1 DIRTH=STONEH+` STONEH=STONEH+(-RND(2))+RND(2) `the actual random terrain factor IF DIRTH>14 THEN INC DIRT,1:SKIP=1 DIRTX=16-STONEH '(filling in the bottom part with dirt) WHILE SKIP==0 FOR X=0 TO DIRTX BGPUT 0,DIRT,DIRTH,332 INC DIRTX,1 NEXT WEND NEXT