local letters = {}
local numletters = 0

-- init the matrix and create some letters...
function InitMatrix()
         for x=0, screenwidth(), 15 do
             for y=0, screenheight(), 35 do
             
                 letters[numletters] = {}
                 letters[numletters]["x"]=x
                 letters[numletters]["y"]=y
                 letters[numletters]["i"]=math.random(0,255)
                 letters[numletters]["ys"]=math.random(4,10)    
                 if math.random(0,1)==1 then
                    letters[numletters]["c"]="1"
                 else
                     letters[numletters]["c"]="0"
                 end             
                 
                 numletters = numletters + 1
             end
         end

end

-- draw our matrix
function DrawMatrix(fontindex)
     
     for l=0, numletters-1 do
          
          drawgfxtext(fontindex, letters[l]["x"], letters[l]["y"], letters[l]["c"], 0, 74+math.sin(clock()/1000)*32, 0)
             
          letters[l]["y"]=letters[l]["y"]+letters[l]["ys"]

          if letters[l]["y"]>screenheight() then
             letters[l]["y"]=-16
          end
     end		
end
