You could make an array, like "dim gem_array(11,10)" for a 10x10 gem board. Then you could have every gem above line 1 check if the spot underneath have become empty or is about to become empty.
gem_array(11,10) = 5 (then the spot is becoming empty)
gem_array(11,10) = 1-4 (spot is occupied)
`this will fill the array
for y = 1 to 11
for x = 1 to 10
`fills the array with random gems
gem_array(y,x) = rnd(4) + 1
next x
next y
`this checks if there is an empty spot in the array
`line 11 should not be visible but holds gems that are ready to fall down in to grid as spots become empty
for y = 2 to 11
for x = 1 to 10
if gem_array(y-1,x) = 5
`initiate cool falling sequence here
`move the gem one line down in the array
gem_array(y-1,x) = gem_array(y,x)
`remove the gem from the original spot
gem_array(y,x) = 5
endif
next x
next y
`this will fill line 11 with random gems
for x = 1 to 10
if gem_array(11,x) = 5 then gem_array(11,x) = rnd(4) + 1
next x
The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...