Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Rollball 20 lines, no media

Author
Message
Peregrin
20
Years of Service
User Offline
Joined: 13th Mar 2004
Location:
Posted: 17th Mar 2004 13:03
Greetings all,
Here's a little 20-lines game; it's quite simple: you control a ball rolling on a road with left and right arrows; avoid the stone blocks and grab the coins; speed builds up with time; game ends when you hit a block.
Advices and comments most welcome !
Peregrin
20
Years of Service
User Offline
Joined: 13th Mar 2004
Location:
Posted: 17th Mar 2004 13:06
What the ?!
Code is incomplete... I'll post it again:
Peregrin
20
Years of Service
User Offline
Joined: 13th Mar 2004
Location:
Posted: 17th Mar 2004 13:07
I'm sorry... Code is still not completely shown !
Here it is:

Hide Mouse : Sync On : Sync Rate 30 : make matrix 1,100,50000,1,1000 : x#=50 : z#=30 : make object sphere 1,10 : color object 1,rgb(250,0,250) : set object collision to spheres 1
for c=2 to 4 : make object cylinder c,5 : Xrotate object c,90 : fix object pivot c : scale object c,100,100,20 : color object c,rgb(250,250,0) : xc=rnd(80) : zc=z#+((c-1)*50) : yc=get ground height(1,xc,zc)+5 : position object c,xc+10,yc,zc
set object collision to spheres c : next c
make object cube 5,20 : color object 5,rgb(100,100,100) : set object collision to boxes 5 : xo=rnd(60) : zo=z#+120+rnd(50) : yo=get ground height(1,xo,zo)+10 : position object c,xo+20,yo,zo
Do
Set cursor 0,0 : print "Score: ";score : position object 1,x#,get ground height(1,x#,z#)+5,z# : position camera 50,70,z#-10 : point camera 50,0,z#+30 : oldx#=x# : ax#= object angle X(1) : az#= object angle Z(1)
if perdu=1 then print "PERDU ! Appuyez sur Espace pour quitter..."
vit#=(z#/3000)+1 : z#=z#+vit# : Xrotate object 1,wrapvalue(ax#+(10*vit#))
if leftkey()=1 then x#=x#-1 : Zrotate object 1,wrapvalue(az#+10) : fix object pivot 1
if rightkey()=1 then x#=x#+1 : Zrotate object 1,wrapvalue(az#-10) : fix object pivot 1
if x#<10 or x#>90 then x#=oldx#
for c=2 to 4
Yrotate object c,wrapvalue(object angle Y(c)+10)
if object collision(c,1)=1 then score=score+1 : xc=rnd(80) : zc=z#+100+rnd(50) : yc=get ground height(1,xc,zc) : position object c,xc+10,yc+5,zc
if object position Z(c)<z#-20 then xc=rnd(80) : zc=z#+110+rnd(50) : yc=get ground height(1,xc,zc) : position object c,xc+10,yc+5,zc
next c
if object collision(5,1)=1 then hide object 1 : set object collision off 1 : T#=timer() : perdu=1
if spacekey()=1 and perdu=1 then end
if object position Z(5)<z#-25 then xo=rnd(60) : zo=z#+120+rnd(50) : yo=get ground height(1,xo,zo) : position object c,xo+20,yo+10,zo
Sync : Loop

Better ?
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Mar 2004 14:43
Not bad. For your info, code will post properly if you put spaces around any '<' operators. Stupid forum thinks you are posting html code and knocks out anything after a '<' if followed by anything other than a space.



Boo!

Login to post a reply

Server time is: 2024-04-25 05:51:44
Your offset time is: 2024-04-25 05:51:44