MITライセンスにしておきます。
chr ={
cnt=400,
x={},
y={},
dx={},
dy={},
life={},
init = function(self)
for i=1,self.cnt do
self.x[#self.x+1]=0
self.y[#self.y+1]=0
self.dx[#self.dx+1]=0
self.dy[#self.dy+1]=0
self.life[#self.life+1]=0
end
end,
set = function(self)
for i=1,self.cnt do
if self.life[i] == 0 then
self.x[i]=120
self.y[i]=68
self.dx[i] = math.random(-1000,1000)*0.0001
self.dy[i] = math.random(-1000,1000)*0.0001
self.life[i]=1
break
end
end
end,
move = function(self)
for i=1,self.cnt do
if self.life[i] > 0 then
self.x[i]=self.x[i]+self.dx[i]
self.y[i]=self.y[i]+self.dy[i]
end
end
end,
draw = function(self)
for i=1,self.cnt do
if self.life[i] > 0 then
spr(1,self.x[i],self.y[i],
14,1,0,0,1,1)
end
end
end
}
t=0
function BOOT()
chr:init()
chr:set()
end
function TIC()
cls(13)
chr:move()
chr:draw()
t=t+1
end