Hi all
**
UPDATE**
okay i have made an update so now you can get out of the matrix(I have used collisions) and the balls are positioned better
here is the
NEW code:
` create the sync setup and that kind of stuff.
cls
print " You a box and you WERE green before the enemy stoled you color!"
print " The enemy need it themself becouse they wanna be green instead of red"
print ""
print " Stop them before they use all you color!."
print "If you dont make it you color will be gone forever!"
print "Get you color back collect the red balls to get you color back!"
print "NOTE: Hurry you dont have much time!"
print "press any key to start the game"
wait key
sync on
sync rate 30
hide mouse
` make a 3D box and some other 3D stuff
make object box 1,10,10,10
color object 1, RGB(255,255,255)
` **This is the enemy box**
make object sphere 2,5,5,5
color object 2, RGB(255,0,0)
` make a matrix
make matrix 1,500,500,20,20
position matrix 1,-11,-11,-10
for x= 3 to 53
make object sphere x,5
color object x, RGB(255,0,0)
position object x, RND(480),RND(-11),RND(480)
next x
` make the timer variable.
Timer#=2500
` **THIS IS THE START OF THE MAIN LOOP**
do
` **THIS IS THE COLLISION AND POINT SYSTEM PART**
` This is the timer system
Timer#=Timer#-1
If Timer#=<0 then end
set cursor 5,5
Print score#
For x=3 to 53
If object exist( x)=1
if score#=10 then color object 1, RGB(30,44,27)
if score#=20 then color object 1, RGB(58,103,56)
if score#=30 then color object 1, RGB(78,158,80)
if score#=40 then color object 1, RGB(87,174,89)
if score#=45 then color object 1, RGB(0,255,0)
If object collision(1,x)=1 then delete object x: score#=score#+1
endif
Next x
if score#=>50
do
set cursor screen width()/2,screen height()/2
set text size 35
set text font "times new roman"
text 300,250, "WELL DONE"
end#=end#+1
if end#=>100 then end
sync
loop
endif
if spillerx#>485 and spillerx#=spillerx# then spillerx#=485
if spillerz#>470 and spillerz#=spillerz# then spillerz#=470
if spillerx#<-5 and spillerx#=spillerx# then spillerx#=-5
if spillerz#<-19 and spillerz#=spillerz# then spillerz#=-19
` **POSITION THE OBJECTS**
position object 1,spillerx#, spillery#, spillerz#
` *Firkantens kontrol system*
if upkey()= 1 then spillerz#=spillerz#+5.0
if downkey()=1 then spillerz#=spillerz#-5.0
if leftkey()= 1 then spillerx#=spillerx#-5.0 : position camera spillerx#+0 , spillery#= 45 , spillerz#=0
if rightkey() = 1 then spillerx#=spillerx#+5.0
` **POSITION THE CAMERA**
position camera spillerx#+0 , spillery#+15 , spillerz#+-45
print Timer#
sync
loop
I have worked on this little mini game and its acually really cool!
(for dbpro i havent tested it in dbc )
You are a 3D box and walk around on a matrix and need to collect 50 red balls on time!
also i have made it so every time you collect 10 red balls you box color will be brighter!
There is a storyline you can read in the game
*Control*
Upkey = move forward
downkey = move backwards
leftkey = move to the left
rightkey = move to the right
Enjoy!
here is the code:
` create the sync setup and that kind of stuff.
cls
print " You a box and you WERE green before the enemy stoled you color!"
print " The enemy need it themself becouse they wanna be green instead of red"
print ""
print " Stop them before they use all you color!."
print "If you dont make it you color will be gone forever!"
print "Get you color back collect the red balls to get you color back!"
print "NOTE: Hurry you dont have much time!"
print "press any key to start the game"
wait key
sync on
sync rate 30
hide mouse
` make a 3D box and some other 3D stuff
make object box 1,10,10,10
color object 1, RGB(255,255,255)
` **This is the enemy box**
make object sphere 2,5,5,5
color object 2, RGB(255,0,0)
` make a matrix
make matrix 1,500,500,20,20
position matrix 1,-11,-11,-10
for x= 3 to 53
make object sphere x,5
color object x, RGB(255,0,0)
position object x, RND(500),RND(0),RND(500)
next x
` make the timer variable.
Timer#=2500
` **THIS IS THE START OF THE MAIN LOOP**
do
` **THIS IS THE COLLISION AND POINT SYSTEM PART**
` This is the timer system
Timer#=Timer#-1
If Timer#=<0 then end
set cursor 5,5
Print score#
For x=3 to 53
If object exist( x)=1
if score#=10 then color object 1, RGB(30,44,27)
if score#=20 then color object 1, RGB(58,103,56)
if score#=30 then color object 1, RGB(78,158,80)
if score#=40 then color object 1, RGB(87,174,89)
if score#=45 then color object 1, RGB(0,255,0)
If object collision(1,x)=1 then delete object x: score#=score#+1
endif
Next x
if score#=>50
do
set cursor screen width()/2,screen height()/2
set text size 35
set text font "times new roman"
text 300,250, "WELL DONE"
end#=end#+1
if end#=>100 then end
sync
loop
endif
` **POSITION THE OBJECTS**
position object 1,spillerx#, spillery#, spillerz#
` *Firkantens kontrol system*
if upkey()= 1 then spillerz#=spillerz#+5.0
if downkey()=1 then spillerz#=spillerz#-5.0
if leftkey()= 1 then spillerx#=spillerx#-5.0 : position camera spillerx#+0 , spillery#= 45 , spillerz#=0
if rightkey() = 1 then spillerx#=spillerx#+5.0
` **POSITION THE CAMERA**
position camera spillerx#+0 , spillery#+15 , spillerz#+-45
print Timer#
sync
loop
comments would be nice too!
The Nerd