Play game
1kStar's itch.io pageCharacters/Bytes used
1024
Source Code
scr={{},{},{}}
f={120,120}
x=10
y=10
b={}
function _update()
ul(scr[1],{7,6,5},2)
ul(scr[2],{6,5},1.5)
ul(scr[3],{13,1},0)
uf(1)
if(btn(0))x=max(x-1,1)
if(btn(1))x=min(x+1,116)
if(btn(2))y=max(y-1,1)
if(btn(3))y=min(y+1,120)
if(btnp(5) and #b<=3)add(b,{x+8,y+2})
for i in all(b)do
i[1] += 1.5
if(i[1] > 127) del(b,i)
if(i[2] > f[flr(i[1])]) del(b,i) r(flr(i[1]),i[2])
end
end
function r(x,y)
f[x]=max(y,f[x])
f[x+1]=max(y,f[x+1])
f[x-1]=max(y,f[x-1])
end
function c(l,s)
if(#l<s) return
for i=1,s do del(l,l[1]) end
end
function ul(l,h,s)
c(l,s)
while (#l<128) do
cl={}
for s=0,flr(rnd(3)) do add(cl, {flr(rnd(128)),rnd(h)}) end
add(l, cl)
end
end
function uf(s)
c(f,s)
while (#f<128) do
add(f,mid(84,f[#f]+flr(rnd(7)-3),120))
end
end
function _draw()
cls()
for s=1,#scr do
ts = scr[s]
for i=1,#ts do
tl = ts[i]
for s=1,#tl do pset(i,tl[s][1],tl[s][2]) end
end
end
for s=1,#f do
line(s,128,s,f[s],6)
end
?"β",x-flr(rnd(2)),y,9
?"β§",x,y,7
?"β",x+3,y,7
for i in all(b)do
pset(i[1],i[2],8)
pset(i[1]-1,i[2],14)
end
end
Link to Commented Source Code
http://hastebin.com/icavebajay.lua
Leave a comment
Log in with itch.io to leave a comment.
Comments
pretty paralax scrolling
Thank you. It was fun to implement.
ππ π
Thank you!