Play game
colour circles's itch.io pageCompressed Bytes used
989
Source Code (OPTIONAL)
x = 64 y = 64
z = 64
px = {x}
py = {y}
pz = {z}
dx = {0}
dy = {0}
dz = {0}
dspeed = {0}
t = 1
vx=0
vy=0
vz=0
angle = 0
angle2 = 0
speed = 0
function _update()
if (btn(0)) then angle=angle-0.01
elseif (btn(1)) then angle=angle+0.01
end
if (btn(2)) then angle2=angle2-0.01
elseif (btn(3)) then angle2=angle2+0.01
end
if (btn(4)) then speed=speed+0.1
elseif (btn(5)) and speed > 0 then speed=speed-0.1
end
vx = speed*sin(angle)*cos(angle2)
vy = speed*cos(angle)*cos(angle2)
vz = speed*sin(angle2)
if x+vx < 0 or x+vx > 128 then
angle=-angle+1
else
x=x+vx
end
if y+vy < 0 or y+vy > 128 then
angle=-angle+0.5
else
y=y+vy
end
if z+vz < 0 or z+vz > 128 then
angle2 = -angle2+1
else
z=z+vz
end
//if vz>3 then vz=3 end
//if vz<-3 then vz=-3 end
add(px,x)
add(py,y)
add(pz,z)
add(dx,vx)
add(dy,vy)
add(dz,vz)
add(dspeed,speed)
t = t+1
end
function _init()
cls(0)
end
function grad_circ_draw(t,i)
if dspeed[i] != 0 then
//circfill(px[i],py[i],(t-i),i)
fillp()
circ(
px[i],
py[i],
(t-i)-abs(pz[i]-z),
flr(i/8))
fillp(flr(2^(flr(i%8)*2)-1)+0.5)
circ(
px[i],
py[i],
(t-i)-abs(pz[i]-z),
flr(i/8)-1)
//flr(i/8))
//flr(pz[i]/16))
//pz[i]+dx[i]+dy[i]+dz[i])
end
end
function circ_draw(t,i)
if dspeed[i] != 0 then
//circfill(px[i],py[i],(t-i),i)
circ(
px[i],
py[i],
(t-i)-abs(pz[i]-z),
i)
//flr(pz[i]/16))
//pz[i]+dx[i]+dy[i]+dz[i])
end
end
function _draw()
z_pat = 2^(flr(z%8)*2)-1
z_col = flr(z/8) - 7
cls(z_col)
fillp(flr(z_pat)+0.5)
rectfill(0,0,128,128,z_col-1)
fillp()
// ceil(sin(angle2)) + flr(sin(angle2)))
if true then
if t > 256 then
for i=t-256,t do
circ_draw(t,i)
end
else
for i=1,t do
circ_draw(t,i)
end
end
end
//if sin(angle2) > 0 then
// circfill(x,y,3,7)
//end
//circfill(
// x+2*sin(angle)*cos(angle2),
// y+2*cos(angle)*cos(angle2),
// 1,
// 0)
fillp()
if sin(angle2) > 0 then
line(
x+3*sin(angle+0.25),
y+3*cos(angle+0.25),
x+3*sin(angle-0.25),
y+3*cos(angle-0.25),
0)
end
line(
x,
y,
x+7*sin(angle)*cos(angle2),
y+7*cos(angle)*cos(angle2),
0)
line(
x+1*sin(angle+0.25),
y+1*cos(angle+0.25),
x+1*sin(angle-0.25),
y+1*cos(angle-0.25),
0)
line(
x+1*sin(angle+0.25),
y+1*cos(angle+0.25),
x+5*sin(angle)*cos(angle2),
y+5*cos(angle)*cos(angle2),
0)
line(
x-1*sin(angle+0.25),
y-1*cos(angle+0.25),
x+5*sin(angle)*cos(angle2),
y+5*cos(angle)*cos(angle2),
0)
line(
x+2*sin(angle+0.25),
y+2*cos(angle+0.25),
x+2*sin(angle-0.25),
y+2*cos(angle-0.25),
0)
line(
x+2*sin(angle+0.25),
y+2*cos(angle+0.25),
x+6*sin(angle)*cos(angle2),
y+6*cos(angle)*cos(angle2),
0)
line(
x-2*sin(angle+0.25),
y-2*cos(angle+0.25),
x+6*sin(angle)*cos(angle2),
y+6*cos(angle)*cos(angle2),
0)
line(
x+3*sin(angle+0.25),
y+3*cos(angle+0.25),
x+7*sin(angle)*cos(angle2),
y+7*cos(angle)*cos(angle2),
7)
line(
x-3*sin(angle+0.25),
y-3*cos(angle+0.25),
x+7*sin(angle)*cos(angle2),
y+7*cos(angle)*cos(angle2),
7)
if sin(angle2) <= 0 then
line(
x+3*sin(angle+0.25),
y+3*cos(angle+0.25),
x+3*sin(angle-0.25),
y+3*cos(angle-0.25),
0)
end
//line(
// x,
// y,
// x-7*sin(angle-0.05)*cos(angle2),
// y-7*cos(angle-0.05)*cos(angle2),
// 7)
//if sin(angle2) <= 0 then
// circfill(x,y,2,7)
//end
end
Leave a comment
Log in with itch.io to leave a comment.