Hello.
The truth is that had never visited this section, the 20 lines.
Soil frequenting the forums but I was not involved had happened here.
I would like to participate and I leave with you some codes.
I hope that is one of your liking.
Thank you.
(If something sounds odd blame the translator of Google.)
---------------
Okay.
Start with a code to create a spider and move with the technique of animation by limbs.
set display mode 1024,768,32:sync on:sync rate 60:backdrop on:color backdrop rgb(255,160,50):hide mouse:set ambient light 40:dim d(18) as float:
lock pixels:for t=1 to 5000:g=rnd(360):r=rnd(200): for p=1 to 25:x=256+((r+p)*sin(g)):z=256+((r+p)*cos(g)):c=255-(p*10):dot x,z,rgb(c,c,c):next p:next t:unlock pixels:get image 1,128,128,384,384
cls:lock pixels:for t=1 to 5000:x=rnd(64):z=rnd(64):c=rnd(200):dot x,z,rgb(25,20+c,25):next t:unlock pixels:get image 2,0,0,63,63
make object sphere 1,0.1:make mesh from object 1,1:make object plain 100,10000,10000:texture object 100,2:scale object texture 100,500,500:xrotate object 100,90:position object 100,500,0,500
for t=1 to 18:for r=1 to 3:read d(r):next r:add limb 1,t,1:offset limb 1,t,d(1)*sin(d(2)),d(3),d(1)*cos(d(2)):if t>10:link limb 1,(t-8)+l,t:inc l:endif:next t
delete mesh 1:make object sphere 2,1:make mesh from object 1,2:delete object 2
for t=2 to 4: for r=1 to 10:read d(r):next r:MakeObj(t):next t:for r=1 to 9:read d(r):next r
for t=5 to 12:read d(10):MakeObj(t):next t:for r=1 to 4:read d(r):next r
for t=13 to 20:for r=5 to 10:read d(r):next r:MakeObj(t):next t:for r=1 to 9:read d(r):next r
for t=21 to 28:read d(10):MakeObj(t):next t:for r=1 to 4:read d(r):next r
for t=29 to 36:for r=5 to 10:read d(r):next r:MakeObj(t):next t:delete mesh 1:g#=0.0:r#=0.0:h#=0.0:d(3)=0:d(5)=90:d(7)=180:d(9)=270
do:inc g#,.5:inc g1#,.3:inc r#,.03:inc h#,15:x#=500+(250*cos(r#)):z#=500+(250*sin(r#)):position object 1,x#,4+(0.1*sin(h#)),z#:yrotate object 1,-r#:rotate limb 1,1,10+(3*cos(h#)),0,0
position camera x#+(20*sin(g#)),12+(10*sin(g#)),z#+(3*cos(g1#)):point camera x#,0,z#:l=0
for t=3 to 9 step 2:inc l,2:inc d(t),5:d(t)=wrapvalue(d(t)):a#=(10+l)*sin(d(t)):b#=15*cos(d(t)):c#=25*sin(d(t)):if t=9:d#=45+(25*sin(d(5))):else:d#=0:endif:if t=3:e#=45+(45*sin(d(5))):else:e#=0:endif
rotate limb 1,t,0,b#-l,15+a#+l*2:rotate limb 1,20-t,0,-b#+l,-15-a#-l*2:rotate limb 1,t+1,-c#+d#+e#,-c#,-90-d#:rotate limb 1,21-t,-c#+d#+e#,c#,90+d#:next t:sync:loop
function MakeObj(t):make object t,1,1:set object emissive t,rgb(155,100,100):scale object t,d(1),d(2),d(3):position object t,d(4)*sin(d(5)),d(6),d(4)*cos(d(5)):rotate object t,d(7),d(8),d(9):glue object to limb t,1,d(10):endfunction
data .5,180,0,1,0,0,.9,45,-.2,.8,75,-.3,.8,105,-.3,.9,135,-.2,.9,225,-.2,.8,255,-.3,.8,285,-.3,.9,315,-.2,3.9,45,-.35,3.85,75,-.5,3.85,105,-.5,3.85,135,-.35,3.9,225,-.35,3.85,255,-.5,3.85,285,-.5
data 3.85,315,-.35,200,140,220,0,0,0,0,0,0,0,240,240,320,1.8,180,.75,10,0,0,1,100,70,110,0,0,0,0,0,0,2,40,40,40,0,0,0,0,0,0,3,5,7,9,11,13,15,17,20,40,400,2,45,-.2,0,45,-6,3,75,-.3,0,75,-7,5,105,-.3,0,105,-7,7,
data 135,-.2,0,135,-6,9,225,-.2,0,225,6,11,255,-.3,0,255,7,13,285,-.3,0,285,7,15,315,-.2,0,315,6,17,30,30,30,0,0,0,0,0,0,4,6,8,10,12,14,16,18,15,20,400,2,45,0,0,45,0,4,75,0,0,75,0,6,105,0,0,105,0,8,
data 135,0,0,135,0,10,225,0,0,225,0,12,255,0,0,255,0,14,285,0,0,285,0,16,315,0,0,315,0,18
The following code is a little joke.
It is a short story.
It could holder "bitter lives" or something like.
set display mode 1024,768,32:sync on:sync rate 60:point light 0,0,-1,3:backdrop on:color backdrop rgb(50,0,255):hide mouse:set camera fov 60:cls rgb(255,255,255):ink 0,0
text 16,24," :) :( ":get image 1,0,16,64,48,1:get image 2,41,16,105,48,1:cls 0:ink rgb(255,255,255),0:text 0,0,"?":get image 3,0,1,10,13,1:obj=0:maxi=20:delay=500
type Caras n,t as integer:x#,y#,z#,v#,g# as float endtype:dim C(0) as Caras:make object plain 1002,1000,1000:color object 1002,rgb(0,255,0):xrotate object 1002,-90:move object 1002,-1
repeat:if obj<100 and array count (C(0))<maxi and timer()-time>delay:time=timer():inc obj:inc maxi,2:dec delay,10:make object sphere obj,1:texture object obj,1:rotate object obj,0,180,90
fix object pivot obj:make object sphere obj+100,1:color object obj+100,0:ghost object on obj+100,4:array insert at top C(0):C(0).x#=(50-rnd(100))/2.0:C(0).z#=3+((50-rnd(100))/3.0)
C(0).y#=30.0+(rnd(100)/10.0):C(0).v#=0.0:C(0).g#=0.001:C(0).n=obj:endif:for t=0 to array count (C(0))-1:inc C(t).v#,C(t).g#:dec C(t).y#,C(t).v#:if C(t).y#<0.0:C(t).y#=0.0:C(t).v#=-C(t).v#
C(t).g#=C(t).g#*2.0:endif:position object C(t).n,C(t).x#,C(t).y#,C(t).z#:point object C(t).n,0,0,-20:if C(t).y#<10:show object C(t).n+100:position object C(t).n+100,C(t).x#,-.5,C(t).z#
scale object C(t).n+100,100-(C(t).y#*10),1,100-(C(t).y#*10):else:hide object C(t).n+100:endif:if C(t).y#=0.0 and abs(C(t).v#)<0.1:array delete element C(0),t:endif:next t:Cam()
until obj=100 and array count (C(0))=0:x#=9.0:clone object 1000,1:texture object 1000,2:clone object 1001,101
repeat:dec x#,0.02:for t=1 to 100:point object t,x#,0,-20:next t:rotate object 1000,180,0,object angle z(1000)+2:position object 1000,x#,0,-15:position object 1001,x#,-.5,-15:Cam()
until x#<=0.0:for t=201 to 300:array insert at top C(0):make object plain t,1,1:texture object t,3:ghost object on t:C(0).g#=rnd(1):if C(0).g#=0:C(0).g#=-1.0:endif:C(0).n=t
C(0).t=timer()+rnd(500):C(0).v#=rnd(1):if C(0).v#=0:hide object t:endif:position object t,object position x(t-200),1,object position Z(t-200):next t:time=timer()
repeat:for t=0 to 99:if timer()-C(t).t>300+(C(t).v#*500):C(t).t=timer():if C(t).v#=0:C(t).v#=1:show object C(t).n:if abs(C(t).g#)=1:C(t).g#=C(t).g#*2:endif:else
C(t).g#=-C(t).g#:C(t).v#=0:hide object C(t).n:endif:endif:if C(t).v#=0:turn object left C(t).n-200,C(t).g#*3:endif:next t:Cam():until timer()-time>5000
for t=1 to 100:point object t,0,0,-20:next t:Cam():delete objects 201,300:Cam():sleep 1000:for t=1 to 100:texture object t,2:next t:position camera 0,5,-25:sync:sync
sleep 2000:for t=1 to 90:turn object left 1000,1.5:Cam():next t:sleep 1000:for t=1 to 180:turn object right 1000,1.5:Cam():next t:sleep 1000
for t=1 to 90:turn object left 1000,1.5:Cam():next t:sleep 1000:texture object 1000,1:sync:sync:sleep 2000:x#=object position x(1000)
repeat:dec x#,0.02:for t=1 to 100:point object t,x#,0,-20:next t:rotate object 1000,180,0,object angle z(1000)+2:position object 1000,x#,0,-15:position object 1001,x#,-.5,-15:Cam():until x#<-9.5
end
function Cam():position camera 0,5,-25:sync:endfunction
The following code is a game.
These go in the shortest possible time a mile road.
The system to run the car is pressing cursors.
Click cursors alternately left and right as quickly as possible to move the car.
set display mode 1024,768,32:sync on:sync rate 30:set camera range 0.3,20000:set camera fov 40:hide mouse:w=rgb(255,255,255):lock pixels:for t=195 to 205:c=325-(t*15):ink rgb(c,c,c),0:line t,0,t,80:next t:for t=5 to 50:c=255-(t*20):ink rgb(c,c,c),0:line 0,t,400,t
next t:for r=2 to 3:for t=17 to 43 step 13:circle 202,t,r:next t:next r:for x=0 to 256:for y=256 to 512:dot x,y,rgb(rnd(50),150+rnd(105),rnd(50)):next y:next x:for x=512 to 1024:for y=0 to 512:c=rnd(100):dot x,y,rgb(c,c,c):next y:next x:box 512,250,768,262,w,w,w,w
b=rgb(255,255,0):for y=520 to 648 step 16:if t=0:t=8:else:t=0:endif:for x=t to 1024 step 16:box x,y,x+8,y+16,b,b,b,b:next x:next y:b=rgb(4,4,4):box 16,552,496,632,b,b,b,b:box 528,552,1008,632,b,b,b,b:ink w,0:set text font "verdana":set text size 120:set text to italic
text 46,541,"M E T A":set text size 70:text 542,555,"S A L I D A":unlock pixels:get image 1,0,0,400,80:get image 2,0,256,256,512:get image 3,512,0,1024,512:get image 4,0,520,512,664:get image 5,0,520,16,648:get image 6,0,520,512,552:get image 7,512,520,1024,664
backdrop on:color backdrop rgb(50,50,200):fog on:fog color rgb(50,50,200):fog distance 29000:make object plain 1,5000,14:position object 1,50,7,2500:texture object 1,1:scale object texture 1,40,1:set object transparency 1,4:set object emissive 1,rgb(255,255,255)
yrotate object 1,90:instance object 2,1:position object 2,-50,7,2500:yrotate object 2,90:clone object 3,1:position object 3,-43,0.4,2500:yrotate object 3,90:xrotate object 3,90:ghost object on 3,1:instance object 4,3:position object 4,57,0.4,2500:yrotate object 4,90
xrotate object 4,90:ghost object on 4,1:make object plain 5,5000,5000:xrotate object 5,-90:yrotate object 5,90:texture object 5,2:position object 5,0,0,2500:scale object texture 5,40,40:set object light 5,0:make object plain 7,5500,96:xrotate object 7,-90
yrotate object 7,90:texture object 7,3:position object 7,0,0.1,2500:scale object texture 7,44,1:set object light 7,0:make object plain 40,140,18:texture object 40,4:set object light 40,0:make object cylinder 41,2:scale object 41,100,5000,100:texture object 41,5
scale object texture 41,1,8:clone object 42,41:make object plain 43,96,6:xrotate object 43,-90:texture object 43,6:set object light 43,0:make object plain 44,96,18:xrotate object 44,-90:texture object 44,7:set object light 44,0:make object sphere 45,6,3,4
scale object 45,300,60,20:color object 45,rgb(10,10,10):make object sphere 46,3:color object 46,rgb(255,0,0):make object sphere 47,3:color object 47,rgb(255,255,0):make object sphere 48,3:color object 48,rgb(0,255,0):for t=10 to 30:make object cone t,1000
scale object t,500+rnd(t*100),100+rnd(t*10),100:color object t,rgb(187,90,0):position object t,(t*1500)-20000,0,6000+rnd(t*800):next t:make object sphere 50,10:scale object 50,200,30,250:xrotate object 50,10:make object cylinder 51,6:scale object 51,50,110,160
xrotate object 51,-90:make mesh from object 1,51:delete object 51:add limb 50,1,1:offset limb 50,1,-3,0.1,-0.5:add limb 50,2,1:offset limb 50,2,3,0.1,-0.5:add limb 50,3,1:offset limb 50,3,0,-5,2:rotate limb 50,3,0,90,0:scale limb 50,3,140,150,140:delete mesh 1
position object 50,0,15,20:color object 50,rgb(255,0,0):set object emissive 50,rgb(25,0,0):set object ambience 50,rgb(50,50,50):set object diffuse 50,rgb(200,0,0):point light 0,10,-40,100:make object cylinder 9,7:position object 9,0,5,32:scale object 9,100,430,100
rotate object 9,-90,-90,0:texture object 9,3:position camera 0,29,-8:set text size 40:do:salida#=85.0:meta#=4000.0:v#=0.0:vf#=0.0:vm#=0.0:a#=0.0:s=0:for t=46 to 48:for f=46 to 48:ghost object on f,1:next f:ghost object on t,4:run(meta#,salida#,v#):if t<48:time=timer()
repeat:sync:until timer()-time>2000:endif:next t:time=timer():do:if s<=30:if meta#>40.0:t=timer()-time:s=t/1000:t=t-(s*1000):c=t/10:s#=(350-vf#)/800000.0:tecla=leftkey()+(rightkey()*2):dec v#,v#/50:if v#<0.0001 then v#=0.0:dec a#,s#/10:if a#<0.0 then a#=0.0
if (tecla=1 and ult<>1) or (tecla=2 and ult<>2):inc a#,s#:inc v#,a#:if v#>0.35:v#=0.35:ult=tecla:endif:endif:vf#=v#*1000:if vf#>vm#:vm#=vf#:endif:else:dec v#,0.005:if v#<0.0001:v#=0.0:endif:endif:if v#>0.0 or meta#>40.0:text 0,0,left$(str$(vf#),6)+"Km/h"
text 0,40,str$(s)+":"+str$(c):dec meta#,v#*125.0:dec salida#,v#*125.0:run(meta#,salida#,v#):endif:endif:if s>30 or (v#=0.0 and meta#<=40.0):text 0,0,"Max. speed: "+left$(str$(vm#),6)+"Km/h"
text 0,40,"Time: "+str$(s)+" seconds and "+str$(c)+" hundredth":text 0,100,"Press <ENTER> to start the race...":if returnkey()=1:exit:endif:endif:sync:loop:loop
function run(m#,s#,v#):restore DATOS:for t=40 to 48:read x#,y#:if t<44:z#=m#:else:z#=s#:endif:position object t,x#,y#,z#:next t:for t=1 to 9 step 2:scroll object texture t,v#,0:next t:endfunction
DATOS: data 0,70,-71,30,71,30,0,.2,0,.2,0,44.5,-4,44.5,0,44.5,4,44.5
This code is quite simple but I think interesting.
For me it is an authentic 20 lines because they are 20 lines of code standard, without uniting with each other.
This time I try to play the movement of a worm or caterpillar.
set display mode 1024,768,32:sync on:sync rate 60:autocam off:position camera 0,0,-10:hide mouse
dim s#(12) as float:x1#=-3.0
for t=1 to 12
inc g,14
make object sphere t,2.0*sin(g),20,12
s#(t)=(t-1)* 30
next t
color object 12,rgb(60,30,30)
repeat
x#=x1#
for t=12 to 1 step -1
s#(t)=wrapvalue(s#(t)+2.0)
if t<12 then scale object t,90+(20*sin(s#(t))),90-(20*sin(s#(t))),90+(15*sin(s#(t)))
y#=-(object size(t,1)/2.0)*sin(s#(t))
x#=x#-(sqrt(object size x(t,1)/4.0))
position object t,x#,y#,0
next t
inc x1#,0.015*sin(s#(12)/2.0)
sync
until x1#>12.0
And finally a code to show that you can create shadows using a "black light".
set display mode 1024,768,32:sync on:sync rate 30:backdrop on:color backdrop 0:hide mouse:autocam off
ink rgb(255,0,0),0:box 0,0,16,16:get image 1,0,0,16,16:set ambient light 40
dim p#(7,2) as float:dim g#(7,2) as float
for L=1 to 7
make object sphere L,0.5:Make Light L:Set Spot Light L, 0, 45:Color Light L,-255,-255,-255
p#(L,1)=4.0-(rnd(80)/10.0):p#(L,2)=4.0-(rnd(80)/10.0):g#(L,1)=rnd(360):g#(L,2)=rnd(360)
next L
make matrix 1,12,12,80,80:prepare matrix texture 1,1,1,1:position matrix 1,-5,0,-5
position camera 12,5,-10:point camera -3,0,3
do
for n=1 to 7
g#(n,1)=wrapvalue(g#(n,1)+2):g#(n,2)=wrapvalue(g#(n,2)+4)
x#=p#(n,1)+(3.0*sin(g#(n,1))):y#=3+(2.0*sin(g#(n,2))):z#=p#(n,2)+(3.0*cos(g#(n,1)))
position object n,x#,y#,z#
Set Light Range n, 15-y#
Position Light n,x#,y#,z#
Point light n,x#,-y#,z#
next n
sync
loop
---------------
Most of them do not have a purpose practiced (except the last).
The write for fun.
Only that.
Goodbye.