Play game
1K Maze + Car + Light #Pico1K's itch.io pageCharacters/Bytes used
997 characters
Source Code
_set_fps(60)q=16w=2^10c=200k=c::s::memset(8*w,1,8*w)m=mset
for i=0,191do v=ord("###4I0#Bb:184a(-,1)-4a(>,9QQb2Cb",i\6+1)-35sset(q+i%24,i\24,1+v\2^(i%6)%2)end
t={1,0,0,-1,-1,0,0,1}n=mget
p={{1,1}}m(1,1)while #p>0do
e=p[#p]x=e[1]y=e[2]j=rnd(4)\1for i=j,j+3do
d=1+i%4*2u=t[d]v=t[d+1]a=x+u*2b=y+v*2
if(n(a,b)==1and a<127and b<31)m(x+u,y+v)m(a,b)add(p,{a,b})break
if(i-j>2)del(p,e)
end
end
while k>0do
x=rnd(128)y=rnd(64)
if(n(x,y)<1)m(x,y,2)k-=1
end
s=0r=80x=1y=1d=0e=1f=1l=0z=btn::_::cls()r-=.05l+=.2circfill(64,64,r,1)memcpy(w\2,24*w,4*w)u=0v=0
if(r<4)goto s
if(d>0)u=t[d]v=t[d+1]
if(z(0))e=5
if(z(1))e=1
if(z(2))e=3
if(z(3))e=7
if l>=1then
l-=1x+=u
y+=v
if(n(x,y)>1)m(x,y)r+=8c-=1s+=1?"\as4ceg"
a=t[e]b=t[e+1]
if n(x+a,y+b)!=1then
u,v,d,f=a,b,e,e
else
if(n(x+u,y+v)==1)u=0v=0d=0
end
end
a=8*(x+u*l)b=8*(y+v*l)cls(13)camera(a-60,b-60)pal({[0]=5,13,9})palt(0)map()pal()palt(1,1)pal(2,15)i=(f-1)\2spr(3+i%2,a,b,1,1,i==2,i==3)camera()palt(0,nil)spr(q,0,0,q,8)spr(q,0,64,q,8,nil,1)
?s,8,1,7
flip()goto _
Leave a comment
Log in with itch.io to leave a comment.
Comments
Really cool mechanic/twist on maze games! ๐๐
Thanks! I was disappointed I was not able to use the full 128x64 map because I was using a bit more than half the sprite sheet for a few sprites and the light mask. But in the end, I think playing the finished game feels good. And I could get the right logic for player controls that I couldn't get on the previous maze game due to being short on chars: in that game, if you change direction a bit too early, you get stuck.