very nice idea and I love the visuals. I feel that the game could become harder after a while so you would be kept on your toes
Play game
Crusin' Cyber Highway 9's itch.io pageCompressed Bytes used
1024
Source Code (OPTIONAL)
camera(-64,-64)posz=0
::start::
cls()?-posz.." cyber metres",-35,0
?"press โ",-20,6
if(btn(โ))goto real
flip()goto start::real::
sc={{-.25,0,-1},{.25,0,-1},{.75,0,0},{-.75,0,0},{0,.5,0}}
faces={{1,2,3,4},{4,5,3},{1,2,5}}
r=0n=4f=64๐ฑ1=(f+n)/(n-f)๐ฑ2=2*f*n/(n-f)๐จ=16rm=๐จ+1posz=0posx=0rep=72sz=posz-4sx=posx
function gh(x,z)bh=sin((x+z)/(rep/2))+cos(z/rep)
if abs(x)==๐จ then
bh=8elseif abs(x)>=๐จ/1.5then bh=4end
return bh/2end
hj={}
for z=0,๐จ-1do
for x=1,๐จ do
add(hj,{x+z*rm,x+1+z*rm,x+1+(z+1)*rm,x+(z+1)*rm})
end
end
function ic(fz,lz)return lz>=-1and lz<=1and fz>=-1and fz<1end
function df(sq,๐ฑ)
for i=1,#sq do
cp=๐ฑ[sq[i]]np=๐ฑ[sq[(i%(#sq))+1]]
if ic(np[3],cp[3])then
line(np[1]*64,-np[2]*64,cp[1]*64,-cp[2]*64,col)end
end
end
function tm(๐ฑ)
x=๐ฑ[1]-posx
y=๐ฑ[2]-ch
z=๐ฑ[3]-posz
w=-z
x/=w
y/=w
z=z*๐ฑ1+๐ฑ2
z=z/w
return{x,y,z}
end
es={}
function ds(sx,sz,rot,scol)
w={}
for ๐ฑ in all(sc)do
add(w,{๐ฑ[1]+sx,๐ฑ[2]+gh(sx,sz),๐ฑ[3]+sz})
end
sp={}
for ๐ฑ in all(w)do
add(sp,tm(๐ฑ))
end
col=5
fillp(โ)
for i=1,#faces do
df(faces[i],sp)
end
w={}
for ๐ฑ in all(sc)do
y=๐ฑ[2]z=๐ฑ[3]x=๐ฑ[1]xx=cos(rot)*x+y*sin(rot)yy=-sin(rot)*x+cos(rot)*y
add(w,{xx+sx,yy+gh(sx,sz)+.5,z+sz})
end
sp={}for ๐ฑ in all(w)do
add(sp,tm(๐ฑ))end
col=scol
fillp()for i=1,#faces do
df(faces[i],sp)
end
end
::loop::
cls()ch=gh(posx-1,posz)+4h={}l=-๐จ*2l+=posz/2\1*2u=l+๐จ*2+2
for z=l,u,2do
for x=-๐จ,๐จ,2do
add(h,{x,gh(x,z),z})end
end
if(rnd()<0.05)and#es<21then
x=rnd((๐จ-6)*2)-(๐จ-6)add(es,{x,l,max(-0.4,rnd(2)-1)})
end
tp={}for ๐ฑ in all(h)do
add(tp,tm(๐ฑ))end
for i=1,#hj do
col=8fillp()
if(i<๐จ*5)col=2
if(i<๐จ*3)col=1
if(i<๐จ*2)col=1fillp(โ)
df(hj[i],tp)end
for ๐ฑ in all(es)do
๐ฑ[2]+=๐ฑ[3]
ds(๐ฑ[1],๐ฑ[2],0,12)
if(๐ฑ[2]>u)del(es,๐ฑ)
if(((๐ฑ[1]-sx)^2+(๐ฑ[2]-sz)^2)<1or gh(sx,sz)>=2)goto start
end
ds(sx,sz,r,7)posz-=.5sz-=.5๐ณ=0
if(btn(โฌ
๏ธ))๐ณ=.05
if(btn(โก๏ธ))๐ณ=-.05
e=๐ณ-r
r+=e/5posx-=r*8.3sx-=r*10.3?-posz\1,-5,-64,7
flip()goto loop
Leave a comment
Log in with itch.io to leave a comment.