To give some life to this section, I made crazy game where we can not jump but walk over lifts to reach an sphere that is on one of the lifts. Every time we move to next lift,the lift will start moving up or down. We just use arrowkeys to play .Good luck !!
compressed
autocam off :sync on :ink rgb(20,20,20),0:box 0,0,20,20:ink rgb(200,200,200),0:box 2,2,18,18:ink rgb(20,20,20),0:box 8,8,12,12:get image 1,0,0,20,20,1:ink rgb(255,255,0),0 :for i= 1 to 15: make object box i,5,0.5,5:color object i,rgb(rnd(255),rnd(255),rnd(255)):set light mapping on i,1:next i:restore baldosa
box 0,0,screen width(),screen height(),rgb(55,0,130),rgb(0,155,90),rgb(0,0,255),rgb(55,255,255) :get image 2,0,0,screen width(),screen height(),1 :texture backdrop 2
for i=1 to 5: for a= 1 to 5:read bloque:if bloque=1:inc ob:position object ob,a*5,-20+rnd(70),30-i*5: endif:next a:next i :make object sphere 16,2:position object 16,object position x(15),object position y(15)+2,object position z(15)
make object box 100,1,2,1:color object 100,rgb(0,255,0):position object 100,object position x(1),object position y(1)+1,object position z(1)
position camera -20,40,-20:point camera 0,15,0:ob=15:set text size 50: do:set cursor 5,5:print sc:ink rgb(255,255,0),0
for i= 1 to 15:if object collision(100,i) then move object up i,0.02
if object position y(i)>40 then xrotate object i,180 :if upkey() then move object 100,0.03
if object position y(i)<-20 then xrotate object i,0 :
next i :for i= 1 to 15: if object collision(100,i): position object 100,object position x(100),object position y(i)+1,object position z(100):endif :next i
if object collision(100,0)=0 then move object down 100,0.1:position object 16,object position x(ob),object position y(ob)+2,object position z(ob)
position camera object position x(100),object position y(100)+10,object position z(100) :move camera -20: if downkey() then move object 100,-0.03
if leftkey() then g#=g#-0.2 else if rightkey() then g#=g#+0.2
yrotate object 100,g# :yrotate camera g# :if object collision(100,16) :ob=1+rnd(14) :position object 16,object position x(ob),object position y(ob),object position z(ob):sleep 100
sc=sc+50
endif
if object position y(100)<-50 then set cursor 150,200:print "Try again ":sc=0
if object position y(100)<-100
ob=1+rnd(14)
position object 16,object position x(ob),object position y(ob),object position z(ob) :position object 100,object position x(1),object position y(1)+1,object position z(1)
endif
sync :loop
baldosa:
data 1,0,1,1,0,0,1,1,0,1,1,1,0,1,0,0,1,0,0,1,0,1,1,1,1
As we all knows, sometimes we'v got problems with lots of IF command so:
Un-compressed
autocam off
sync on
color backdrop 0
ink rgb(20,20,20),0:box 0,0,20,20:ink rgb(200,200,200),0:box 2,2,18,18:ink rgb(20,20,20),0:box 8,8,12,12:get image 1,0,0,20,20,1
box 0,0,screen width(),screen height(),rgb(55,0,130),rgb(0,155,90),rgb(0,0,255),rgb(55,255,255)
get image 2,0,0,screen width(),screen height(),1
texture backdrop 2:ink rgb(255,255,0),0
`creamos las quince baldosas
for i= 1 to 15
make object box i,5,0.5,5
color object i,rgb(rnd(255),rnd(255),rnd(255))
set light mapping on i,1
next i
`leemos la distribucion de baldosas en el Data
restore baldosa
for i=1 to 5
for a= 1 to 5
read bloque
if bloque=1
inc ob
position object ob,a*5,-20+rnd(70),30-i*5
endif
next a
next i
`bola que tenemos que buscar
make object sphere 16,2:position object 16,object position x(15),object position y(15)+2,object position z(15)
`jugador
make object box 100,1,2,1:color object 100,rgb(0,255,0)
position object 100,object position x(1),object position y(1)+1,object position z(1)
`habitaculo
make object box 101,60,150,60:texture object 101,1:scale object texture 101,10,10:set object cull 101,0
set object collision off 101
position object 101,12,0,12
hide object 101
position camera -20,40,-20
point camera 0,15,0
ob=15
set text size 50
do
set cursor 5,5
print sc
`movimiento de las baldosas
for i= 1 to 15
if object collision(100,i) then move object up i,0.02
if object position y(i)>40 then xrotate object i,180
if object position y(i)<-20 then xrotate object i,0
next i
`condiciones para poder estar sobre las baldosas
for i= 1 to 15
if object collision(100,i)
position object 100,object position x(100),object position y(i)+1,object position z(100)
endif
next i
`si no estamos sobre algna baldosa, caemos !!
if object collision(100,0)=0 then move object down 100,0.1
`colocacion de la bola sobre la baldosa elejida
position object 16,object position x(ob),object position y(ob)+2,object position z(ob)
position camera object position x(100),object position y(100)+10,object position z(100)
move camera -20
`movimiento del jugador
if upkey() then move object 100,0.03
if downkey() then move object 100,-0.03
if leftkey() then g#=g#-0.2
if rightkey() then g#=g#+0.2
yrotate object 100,g#
yrotate camera g#
`chequeo de posicion de la bola
if object collision(100,16)
ob=1+rnd(14)
position object 16,object position x(ob),object position y(ob),object position z(ob):sleep 100
sc=sc+50
endif
if object position y(100)<-50 then set cursor 150,200:set text size 50 :print "Try again ":sc=0
if object position y(100)<-100
ob=1+rnd(14)
position object 16,object position x(ob),object position y(ob),object position z(ob)
position object 100,object position x(1),object position y(1)+1,object position z(1)
endif
sync
loop
baldosa:
data 1,0,1,1,0
data 0,1,1,0,1
data 1,1,0,1,0
data 0,1,0,0,1
data 0,1,1,1,1
Cheers.
I'm not a grumpy grandpa