Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

1k PipesView game page

Little pipe-based puzzle game in 1024 bytes #Pico1k
Submitted by Matt Young — 4 days, 19 hours before the deadline
Add to collection

Play game

1k Pipes's itch.io page

Compressed Bytes used
1022

Source Code (OPTIONAL)
ss={
0x00dd.dd00,0x0001.1000,0xd001.1000,0xd111.1000,0xd000.0000,0x0000.0000,0xd001.100d,0xd221.122d
}
s1={
1,2,2,2,2,2,2,1,1,2,3,4,4,5,6,6,1,2,7,8,8,7,2,1
}
fs={
{3,-1,1,-1},{4,-1,-1,1},{3,4,1,2}
}
dx={0,1,0,-1}
dy={1,0,-1,0}
_b=0
_c=0
function tt(x,y)
return _j[y*16+x+1]
end
function s(x)
sfx(0,0,x,1)
end
_b=0
function _init()
_d=false
_e=6
_f=1
_g=0
_h=7
_i=1
_a(1, 0)
mset(0,0,1)
_a(5, 8)
mset(1,0,5)
_a(9, 16)
mset(2,0,9)
_j={}
for y=1,16 do
for x=1,16 do
tp=rnd({0,1,1,1,2,2})
pp={
x=x,y=y,t=tp,r=rnd({0,1,2,3}),f={}
}
for k,v in pairs(fs[tp+1]) do
pp.f[k]=v
end
add(_j,pp)
end
end
tt(7,0).t=0
tt(7,0).r=0
tt(7,0).f={0,0,0,0}
tt(7,0).l=t
tt(7,1).t=1
tt(7,1).r=2
tt(7,1).f={4,-1,-1,1}
_j[flr(rnd(240)+17)].a=t
g=0x0624
poke2(0x3200,g,g+2,g+4,g+6
)
s(0)
end
function _a(sp, d)
a=512 * (sp \ 16) + 4 * (sp % 16)
for i=0,7 do
poke4(a+64*i,ss[s1[d+i+1]])
end
end
function _update()
np=tt(_h,_i)
p=(_g-np.r)%4
d=np.f[p+1]
if d > 0 then
_g=fs[3][(d-1+np.r)%4+1]-1
_b +=1
np.f[p+1]=0
np.f[d]=0
np.l=t
_h +=dx[_g+1]
_h %=16
_i +=dy[_g+1]
_i %=16
s(3)
if(np.a) _init()
elseif _d then
elseif np.l then
_d=true
s(1)
end
n=tt(_e,_f)
if _d then
if(btnp(4) or btnp(5)) then
_b=0
_init()
end
elseif(n.l) then
elseif btnp(4) then
n.r-=1
s(2)
elseif btnp(5) then
n.r+=1
s(2)
end
n.r %=4
if btnp(0) then
_e-=1
elseif btnp(1) then
_e+=1
elseif btnp(2) then
_f-=1
elseif btnp(3) then
_f+=1
else
return
end
_c=0
_e %=16
_f %=16
end
function _draw()
cls(1)
for i=1,256 do
t=_j[i]
pal(1,3)
pal(2,5)
if(t.f[1]==0) pal(1,12)
if(t.f[2]==0) pal(2,12)
for l=0,7 do
x0=t.x*8-8
y0=t.y*8-8
x1=x0+7
y1=y0+7
if t.r==1 then
tline(
x0+l, y1,x0+l, y0,t.t, l/8
)
elseif t.r==2 then
tline(
x1, y1-l,x0, y1-l,t.t, l/8
)
elseif t.r==3 then
tline(
x1-l, y0,x1-l, y1,t.t, l/8
)
else
tline(
x0, y0+l,x1, y0+l,t.t, l/8
)
end
end
if(t.a) rectfill(x0+3,y0+3,x0+4,y0+4,8)
end
if _d then
cls(1)
print(_b,59,58,7)
else
if(_c < 16) rect(_e*8,_f*8,_e*8+7,_f*8+7,7)
_c +=1
_c %=32
print(_b,7)
end
end

Leave a comment

Log in with itch.io to leave a comment.

Comments

HostSubmitted(+1)

This is a great idea - really fun, but also challenging too.
Looks great too - love the fact that pipes can go *under* also.
Kinda therapeutic too, like a desktop toy that you can't stop fiddling with!
Nice one 👍

Developer

Hehe, thanks Paul! I definitely find myself switching between playing slow, then fast.