Adding varying speed
This commit is contained in:
16
pyras.p8
16
pyras.p8
@ -6,10 +6,11 @@ __lua__
|
||||
|
||||
function _init()
|
||||
initpyras()
|
||||
t=0
|
||||
end
|
||||
|
||||
function _update()
|
||||
movepyras()
|
||||
wait()
|
||||
moveguy()
|
||||
eatpyras()
|
||||
end
|
||||
@ -42,7 +43,7 @@ end
|
||||
pyras={}
|
||||
|
||||
function initpyras()
|
||||
for i=1,50 do
|
||||
for i=1,200 do
|
||||
pyras[i]={
|
||||
x=flr(rnd(128)),
|
||||
y=flr(rnd(128))
|
||||
@ -81,12 +82,21 @@ function eatpyras()
|
||||
end
|
||||
-->8
|
||||
function drawbg()
|
||||
offset=1
|
||||
local offset=1
|
||||
if(#pyras>9)offset+=1
|
||||
if(#pyras>99)offset+=1
|
||||
rectfill(0,0,127,127,1)
|
||||
print(#pyras,128-4*offset,1,7)
|
||||
end
|
||||
|
||||
function wait()
|
||||
if t>0.05*#pyras then
|
||||
movepyras()
|
||||
t=0
|
||||
else
|
||||
t+=1
|
||||
end
|
||||
end
|
||||
__gfx__
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
Reference in New Issue
Block a user