Play game
Picotomata's itch.io pageCharacters/Bytes used
1022 Bytes
Source Code
function _init()
j=0k=0a={}t=0p=false
scale={"e2","b2","c3","d3","e3","f#3","g3","b3"}
b=btnp
l=line
end
function _update()
if(b(0))j=(j-1)%8
if(b(1))j=(j+1)%8
if(b(2))k=(k-1)%8
if(b(3))k=(k+1)%8
if(b(4))p=not p
if(b(5))then
n={}n.x=j
n.y=k
n.s=0e=0
for z in all(a) do
if(z.x==n.x and z.y==n.y) then
e=1z.s+=1
if(z.s>3)del(a,z)
end
end
if(e==0)add(a,n)
end
t+=1if(p and t%6==0)then
for n in all(a) do
d=0
if(n.x==0 and n.s==0)n.s=2d=1
if(n.x==7 and n.s==2)n.s=0d=1
if(n.y==0 and n.s==1)n.s=3d=1
if(n.y==7 and n.s==3)n.s=1d=1
if(d==1)then
i=n.x+n.y
?"\ai3x5"..scale[1+i%8]
end
if(n.s==0)n.x-=1
if(n.s==1)n.y-=1
if(n.s==2)n.x+=1
if(n.s==3)n.y+=1
for m in all(a) do
if(n!=m) then
if(n.x==m.x and n.y==m.y)n.s+=1n.s=n.s%4m.s+=1m.s=m.s%4
end
end
end
end
end
function _draw()
cls(1)
for n in all(a) do
x=n.x*16y=n.y*16
rectfill(1+x,1+y,14+x,14+y,9)
if(n.s==0)l(6+x,6+y,6+x,9+y,1,10)
if(n.s==1)l(6+x,6+y,9+x,6+y,1,10)
if(n.s==2)l(9+x,6+y,9+x,9+y,1,10)
if(n.s==3)l(6+x,9+y,9+x,9+y,1,10)
end
x=j*16y=k*16
rect(x,y,15+x,15+y,7)
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
This is awesome! ๐
From a few clicks, I even had something that sounded like a decent tune!
What a great idea for a 1k entry - nice one ๐