Sure, here:
cls
set display mode 1280,800,32
set window off
sync on
sync rate 0
hide mouse
//timer
init_time#=timer()/1000
time#=init_time#
//camera player 1
make camera 1
position camera 1,0,75,0 : point camera 1,0,0,0
//player
make object sphere 10,2
color object 10,rgb (255,255,255)
//o chão
make object box 11,150,1,150
position object 11,0,0,0
color object 11,rgb (50,50,50)
//balls of fire
AI Start
AI Set Radius 1
//balls
function ball(n)
make object sphere n,2
xrotate object n,90
fix object pivot n
position object n,rnd(150),50,rnd(150)
color object n,rgb(rnd(100),50,50)
AI Add Enemy n
AI Set Entity Speed n,rnd(30)
endfunction
set object collision to spheres 10
//GAME LOOP
n=1
do
ball(n)
n=n+1
//posição player 1
pick screen mousex(),mouseY(),50
vectorx# = get pick vector x()
vectory# = get pick vector y()
vectorz# = get pick vector z()
distancey# = -camera position y()*50/vectory#
vectorx# = vectorx#*distancey# + camera position x()
vectorz# = vectorz#*distancey# + camera position z()
position object 10,vectorx#,50,vectorz#+3
//movimento ball of fire
AI Entity Go To Position 1,object position x (10),object position z (10)
AI Entity Go To Position 2,object position x (10),object position z (10)
AI Entity Go To Position 3,object position x (10),object position z (10)
AI Entity Go To Position 4,object position x (10),object position z (10)
AI Entity Go To Position 5,object position x (10),object position z (10)
AI Entity Go To Position 6,object position x (10),object position z (10)
AI Entity Go To Position 7,object position x (10),object position z (10)
AI Entity Go To Position 8,object position x (10),object position z (10)
AI Entity Go To Position 9,object position x (10),object position z (10)
AI Update
//collision
If Object collision(10,1)>0 then goto _JA_FOSTE
If Object collision(10,2)>0 then goto _JA_FOSTE
If Object collision(10,3)>0 then goto _JA_FOSTE
If Object collision(10,4)>0 then goto _JA_FOSTE
If Object collision(10,5)>0 then goto _JA_FOSTE
If Object collision(10,6)>0 then goto _JA_FOSTE
If Object collision(10,7)>0 then goto _JA_FOSTE
If Object collision(10,8)>0 then goto _JA_FOSTE
If Object collision(10,9)>0 then goto _JA_FOSTE
//timer
// set text transparent
SET TEXT FONT "verdana"
SET TEXT SIZE 50
ink rgb(200,200,200),rgb(0,0,0)
`collect updated time
time#=timer()/1000-init_time#
`to make it count down from a value just minus time from that value
time#=60-time#
`convert to minuits and seconds
sec=floor(time#-min*60)
center text 620,25,str$(sec)
sync
loop
//JA FOSTE
_JA_FOSTE:
SET TEXT FONT "verdana"
SET TEXT SIZE 50
ink rgb(170,30,30),rgb(0,0,0)
center text 620,400,"GAME OVER"
sync
wait key
cls
end
here is the thing. All I want is to have a function that substitutes an old for/next:
for n=1 to 9
make object sphere n,2
xrotate object n,90
fix object pivot n
position object n,rnd(150),50,rnd(150)
color object n,rgb(rnd(100),50,50)
AI Add Enemy n
AI Set Entity Speed n,rnd(30)
next n
with a function it will be more handy to build levels and so on.