Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

DeBlockView game page

Yet another falling blocks game
Submitted by Kamencesc (@kamencesc) — 9 days, 21 hours before the deadline
Add to collection

Play game

DeBlock's itch.io page

Compressed Bytes used
1021

Source Code (OPTIONAL)
function _init()b="♥★♪●89bc2431"
q={}
qq={}
t={}
w=8
pts=0
tt=0
⧗={█,█,█}
t[9]={⧗,⧗,⧗,⧗,⧗}
for w=-2,8 do
⧗={0,0,0}
t[w]={⧗,⧗,⧗,⧗,⧗}
end
end
function _update60()
tt+=1
if(tt<60)nc=wp()
if(tt==60)np()
if q[1] then
x,y=cas(q)
if btnp(⬅️) and x>1 then
if(t[y][x-1][1]==0)q[2]-=13
elseif btnp(➡️) and x<5 then
if(t[y][x+1][1]==0)q[2]+=13
end
end
q[2]=mid(8,q[2],60)
if(btnp(⬆️))w-=1
if(btnp(⬇️))w+=1
w=mid(0,w,8)
if(btnp(🅾️))delblock()
if q[1] then
q[3]+=1
x,y=cas(q)
if t[y][x][1]!=0 then
q[3]-=1
t[y-1][x]={unpack(q)}
np()
?"\ao1f"
end
end
grav()
if(t[-1][3][1]>0)_init()?"⁷sax0ba#gf#edc"
end
function _draw()
cls(13)
rrectfill(7,-6,67,128,4,7)
rrectfill(8,-6,65,127,4,5)
rrectfill(87,19,29,31,4,7)
rrectfill(88,20,27,29,4,6)
?"➡️",0,w*13+7,2
?"⬅️",74,w*13+7,2
?"score: "..sub("00000"..pts,-6),75,1,1
?"next",94,24
?"⬅️➡️\nmove blocks\n⬆️⬇️\nmove cursor\n🅾️\nclean blocks",78,64
p(nc[1],95,32)
if q[1] then
p(unpack(q))
end
for n in all(qq) do
p(unpack(n))
end
for n in all(t) do
for m in all(n) do
if m[1]>=1 then
p(unpack(m))
end
end
end
end
function np()
q=nc
nc=wp()
end
function wp()
return {rnd(4)\1+1,34,-13}
end
function p(n,x,y)
rrectfill(x,y,13,13,3,tonum("0x"..b[n+8]))
rrect(x,y,13,13,3,tonum("0x"..b[n+4]))
?b[n],x+3,y+4
end
function cas(●)
x=●[2]-8
y=●[3]+9
return 1+x\13,y\13
end
function retable()
mm=0
for n=8,1,-1 do
for m=5,1,-1 do
if(t[n][m][1]!=0)then
mm+=1
if(t[n+1][m][1]==0)then
add(qq,t[n][m])
t[n][m]=⧗
end
end
end
end
end
function delblock()
v={}
a=0
if t[w][1][1]!=0 then
conn(t[w][1][1],1,1,v)
if(count(v)<2)v={}
end
if count(v)>3 then
conn(t[w][1][1],1,1,v,w+1)
conn(t[w][1][1],1,1,v,w-1)
end
sc(count(v))
for n in all(v) do
t[n[2]][n[1]]=⧗
v={}
a=1
end
if t[w][5][1]!=0 then
conn(t[w][5][1],5,-1,v)
if(count(v)<2)v={}
end
if count(v)>3 then
conn(t[w][5][1],5,-1,v,w+1)
conn(t[w][5][1],5,-1,v,w-1)
end
sc(count(v))
for n in all(v) do
t[n[2]][n[1]]=⧗
a=1
end
if(a>0)retable()
end
function conn(c,x,m,v,l)
l=l and l or w
if x>0 and x<6 and t[l][x][1]==c then
add(v,{x,l})conn(c,x+m,m,v,l)
end
end
function grav()
for n in all(qq) do
n[3]+=1
x,y=cas(n)
if t[y][x][1]!=0 then
n[3]-=1
t[y-1][x]={unpack(n)}
del(qq,n)
end
end
end
function sc(p)
pts+=5*p^(p\2)
end

Leave a comment

Log in with itch.io to leave a comment.

Comments

Submitted

Fun little block dropping game, nice use of the p8scii. Took me a bit to realize that the lines had to be touching the edges to be cleared.