TGC Codebase Backup



500 boxes by Bug Man

1st Sep 2006 23:09
Summary

A little program that places 500 cubes in random places and assigns the cubes random colors:P



Description

Not much......
Don't be to hard on me I'm only 13:(
No Media!



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Sync On
Sync Rate 30
Hide mouse
Rem Make Cubes and place randomly
fog on
make matrix 1,250,250,20,20
color1=rnd(255)
color2=rnd(255)
color3=rnd(255)
For x = 1 to 500
xaxis=Rnd(250)
yaxis=Rnd(250)
depth=rnd(100)
   Make object cube x,2
   Position object x,xaxis,depth,yaxis
   Set object collision to boxes x
   Texture object x,1
   color object x,rgb(color1,color2,color3)
goto newcolor
mainloop:
   next x
camera:
  do
   OldCamAngleY# = CameraAngleY#
   OldCamAngleX# = CameraAngleX#
   CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
   CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
   Rem  Control input for camera
   If Upkey()=1
move camera 1
   Endif
   If Downkey()=1
move camera -1
   Endif
If Leftkey()=1
   XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10)
   ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10)
   endif
If Rightkey()=1
   XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#+90),10)
   ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#+90),10)
   Endif
   Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
   Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
   Rem Refresh Screen
   Sync
loop
newcolor:
color1=rnd(255)
color2=rnd(255)
color3=rnd(255)
   Texture object x,1
   color object x,rgb(color1,color2,color3)
if x=500 then goto camera
   goto mainloop