Code: Select all
mtdark = Color.new(83, 186, 0)
mtlight = Color.new(191, 234, 0)
scrollcount = 5
mtrand = math.random(30, 40)
scrollx = {}
scrolly = {}
scrollorigy = {}
scrollspeed = {}
function setVars(i)
scrollx[i] = math.random(0, 58)
scrolly[i] = math.random(0, 26 / 2)
scrollorigy[i] = scrolly[i]
scrollspeed[i] = math.random(1, 2)
end
for i = 0, scrollcount do
setVars(i)
end
while true do
screen:clear()
for i = 0, scrollcount do
screen:print(6 + (8 * scrollx[i]), 2 + (10 * scrolly[i]), math.random(0, 9), mtlight)
if scrolly[i] > scrollorigy[i] then
for j = 0, scrolly[i] - scrollorigy[i] do
red = (j / (scrolly[i] - scrollorigy[i])) * 191
green = (j / (scrolly[i] - scrollorigy[i])) * 234
screen:print(6 + (8 * scrollx[i]), 2 + (10 * (scrolly[i]-j)), math.random(0, 9), Color.new(191 - red, 234 - green, 0))
end
end
scrolly[i] = scrolly[i] + scrollspeed[i]
if scrolly[i] > 30 then
setVars(i)
if scrollcount < 15 then
scrollcount = scrollcount + 1
setVars(scrollcount)
end
end
end
screen:fillRect(200, 260, 280, 10, Color.new(0, 0, 0))
screen:print(207, 264, "Matrix Simulator for PSP by Zenurb", Color.new(255, 255, 255))
screen.waitVblankStart()
screen.flip()
pad = Controls.read()
if pad:start() then
break
end
end