demos uploaded

This commit is contained in:
2022-05-05 16:32:31 +02:00
parent 012a2606ed
commit 7e9b57dafe
8 changed files with 290 additions and 1 deletions

3
demos/bola.lua Normal file
View File

@@ -0,0 +1,3 @@
p=0.45 a=0 c=cos s=sin function update()cls()for m=0,63 do
N=2*p*(m%8)M=p*flr(m/8)x,y,z=s(M)*c(N),s(M)*s(N),c(M)I,J=c(a),s(a)y,z=y*I-z*J,y*J+z*I
x,z=x*I-z*J,x*J+z*I x,y=x/(z+4),y/(z+4)print(chr(47-sgn(z)),20+x*70,15+y*55)end a=a+0.03 end

6
demos/checker3d.lua Normal file
View File

@@ -0,0 +1,6 @@
for i=0,1199 do poke(i,207) end o=0
function update()o=o-0.05
for y=1,14 do for x=0,39 do
c=(flr((x-20)/(2*y)+o)+flr(10/y))%2
poke(flr(1200+x+(15+y)*40),c*15)end
end end

9
demos/cube.lua Normal file
View File

@@ -0,0 +1,9 @@
a=0 function l(b,c,i,j)d,e=i-b,j-c
s=max(abs(d),abs(e))i,j=d/s,e/s for
v=0,s-1 do b,c=b+i,c+j print("#",b,c)end end
function r(u)f,g,h=(u>>2&1)*2-1,(u>>1&1)*2-1,(u&1)*2-1
f,h=f*cos(a)-h*sin(a),f*sin(a)+h*cos(a)return f/(h+4),g/(h+4)end
function update()cls()for n=0,7 do
x,y=r(n)for k=0,2 do m=n~(1<<k)if m>n then
f,g=r(m)l(20+x*40,15+y*30,20+f*40,15+g*30)
end end end a=a+0.05 end

7
demos/fire.lua Normal file
View File

@@ -0,0 +1,7 @@
f={}p={0,1,5,4,6,12,14,15}for i=0,1199
do f[i]=0 poke(i,143)end
function update()for i=0,1119 do
if i<41 then f[1160+i]=rnd(2)*256 end
f[i]=(f[i+39]+f[i+40]+f[i+41]+f[i+80])/4.1
poke(1200+i,p[mid(0,flr(f[i]/4),7)+1])
end end

4
demos/rotozoom.lua Normal file
View File

@@ -0,0 +1,4 @@
z,a=0,0 function update()for y=0,29 do for x=0,39 do
i,j=x*cos(a)-y*sin(a),x*sin(a)+y*cos(a)i,j=i*z,j*z
print(chr(127+(flr(j)+flr(j))%2),x,y)end end
a=sin(time()/1000)z=abs(a)/3 end

8
demos/starfield.lua Normal file
View File

@@ -0,0 +1,8 @@
mode(0)f={}u={143,143,129,144,144}
function p(i)f[i]={x=40-rnd(80),y=15-rnd(30),z=rnd(5)}end
for i=0,50 do p(i) end
function update()cls()for i=0,50 do
f[i].z=f[i].z-0.05 y=f[i].z
m=40+f[i].x/y n=15+f[i].y/y
if m<0 or n<0 or m>79 or n>29 or y<=0 then p(i)end
print(chr(u[flr(f[i].z)+1]),m,n)end end

27
demos/ticker.lua Normal file
View File

@@ -0,0 +1,27 @@
C=66
a=0
ticker=0
function printchar(C, x,y)
if x<-8 or x>39 then return end
for j=0,7 do
line=peek(2560+C*8+j)
for i=0,7 do
X=x+7-i
ink(1+(flr(X)+j+flr(a))%15)
if X>0 and X<40 then
s=10+sin(a+(X)*0.1)*5
if line & 1 == 1 then print(chr(233),X,y+j+s) end
end
line = line >> 1
end
end
end
function update()
cls()
message="HOLA JAILERS"
for n=0,#message-1 do
printchar(ascii(message,n),n*8-flr(a*4)%(#message*8),0)
end
a=a+0.1
end