In order to use the following code, you will need the 5.4 update or above.
However, andrew11 has given a non condensed version of the code that should work in the older DBPro's. It is bellow this post.
DO NOT BUMP THIS THREAD!!!
****************************
Well, after much thought on the matter, I concluded that Space Drive would be played more if it was in DBPro code. With this in mind, I download the demo of DBPro and started typing away.
After a while, I had managed to completely ruin Space Drive, so I gave up with the conversion.
Then, on that very night, in the irc room #darkbasic, I said hello to 'andrew11' as he stepped in. He then sent me a message asking if I was using a chatbot that said "Hey andrew11" every time that he walked in, the answer was no, I am indeed, sad enough to say hello to anyone...
Anyway, we ended up having a conversation about converting code from DBC to DBPro and somewhere in there, Space Drive. He then offered to convert Space Drive to DBPro for me, to which i said thankyou quite alot.
So, here is the result, there are two versions, both are great.
Controls:
Up: Increase speed
Down: Decrease speed
Left: Move left
Right: Move right
Version 1:
sync on : sync rate 60 : set display mode 640,480,16 : backdrop on : color backdrop rgb(0,0,0): set text size 20: make object cone 1,20: color object 1,RGB(100,50,200): create bitmap 1,512,512: for x = 1 to 1000: dot rnd(512),rnd(512): next x: get image 2,0,0,512,512: delete bitmap 1: make object plain 2,200, 130: position object 2,0,56,0: texture object 2,2: make object sphere 3,10: xrotate object 3,90: position object 3,-70,100,0: scale object 3,100,100,200: color object 3,RGB(225,225,0): position camera 0,80,-100
dim score(0): score(0)=0: dim time(0): time(0)=3000: dim shield(0): shield(0)=100: do : move object 3,5: scroll object texture 2, 0,-.03: ink RGB(0,0,255),0: set cursor 10,0: print "SCORE=",score(0): set cursor 105,0: print "TIME LEFT=",time(0): time(0)=time(0)-1: set cursor 235,0: print "SHIELD=",shield(0)
if time(0) < 0: goto finish: endif: if shield(0) < 0: goto die: endif: if score(0) < 0: score(0)=0: endif: if upkey()=1: move object 3,3: scroll object texture 2, 0,-.02: endif: if downkey()=1: move object 3,-3: scroll object texture 2, 0,.02: endif: if leftkey()=1 and object position x(1) > -75: move object left 1,3: endif: if rightkey()=1 and object position x(1) < 75: move object right 1,3: endif
ink RGB(0,255,0),0: line OBJECT SCREEN x(1), OBJECT SCREEN y(1), OBJECT SCREEN x(3), OBJECT SCREEN y(3): if object position y(3)=<-50: position object 3,-90+rnd(180),150,0: score(0)=score(0)+20: scale object 3,150+rnd(100),100+rnd(100),200+rnd(100): color object 3,RGB(50+rnd(175),50+rnd(175),50+rnd(175)): endif: dist# = (abs(object position x(1)-object position x(3))/object size x(3))^2+(abs(object position y(1)-object position y(3))/object size y(3))^2+(abs(object position z(1)-object position z(3))/object size z(3))^2: if dist# <= 1: score(0)=score(0)-50: shield(0)=shield(0)-3: set text size 60: CENTER text 320,240,"COLLISION ALERT!!!": set text size 20: endif: sync: loop
finish: fog on: fog distance 150: fog color RGB(50,50,100): set cursor 100,80: print "WELL DONE! SCORE=",score(0): set cursor 100,100: print "Press escape to exit" : sync : goto finish
die: fog on: fog distance 150: fog color RGB(100,50,50): set cursor 100,80: print "CRAFT DESTROYED!": set cursor 100,100: print "Press escape to exit" : sync: goto die
Version 2:
sync on : sync rate 60 : set display mode 640,480,16 : backdrop on : color backdrop rgb(0,0,0): set text size 20: make object cone 1,20: color object 1,RGB(100,50,200): make object sphere 3,10: xrotate object 3,90: position object 3,-70,100,0: scale object 3,100,100,200: color object 3,RGB(225,225,0): position camera 0,80,-100
dim score(0): score(0)=0: dim time(0): time(0)=3000: dim shield(0): shield(0)=100: do : move object 3,5: ink RGB(0,0,255),0: set cursor 10,0: print "SCORE=",score(0): set cursor 105,0: print "TIME LEFT=",time(0): time(0)=time(0)-1: set cursor 235,0: print "SHIELD=",shield(0)
if time(0) < 0: goto finish: endif: if shield(0) < 0: goto die: endif: if score(0) < 0: score(0)=0: endif: if upkey()=1: move object 3,3: endif: if downkey()=1: move object 3,-3: endif: if leftkey()=1 and object position x(1) > -75: move object left 1,3: endif: if rightkey()=1 and object position x(1) < 75: move object right 1,3: endif
ink RGB(0,255,0),0: line OBJECT SCREEN x(1), OBJECT SCREEN y(1), OBJECT SCREEN x(3), OBJECT SCREEN y(3): if object position y(3)=<-50: position object 3,-90+rnd(180),150,0: score(0)=score(0)+20: scale object 3,150+rnd(100),100+rnd(100),200+rnd(100): color object 3,RGB(50+rnd(175),50+rnd(175),50+rnd(175)): endif: dist# = (abs(object position x(1)-object position x(3))/object size x(3))^2+(abs(object position y(1)-object position y(3))/object size y(3))^2+(abs(object position z(1)-object position z(3))/object size z(3))^2: if dist# <= 1: score(0)=score(0)-50: shield(0)=shield(0)-3: set text size 60: CENTER text 320,240,"COLLISION ALERT!!!": set text size 20: endif: sync: loop
finish: fog on: fog distance 150: fog color RGB(50,50,100): set cursor 100,80: print "WELL DONE! SCORE=",score(0): set cursor 100,100: print "Press escape to exit" : sync : goto finish
die: fog on: fog distance 150: fog color RGB(100,50,50): set cursor 100,80: print "CRAFT DESTROYED!": set cursor 100,100: print "Press escape to exit" : sync: goto die
I hope that you all enjoy them and feedback would be great!
Thanks again andrew11!
Infra-Dark