TGC Codebase Backup



Snow World by SpazDC

15th Aug 2004 19:06
Summary

Just a world full of snow



Description

An average size matrix with snow, sound effects and not being able to see very far!!
P.S. this is the stuff you need to find
bright01.bmp, rain.wav, wind.wav, and field.mid



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 

Backdrop on 
Set camera range 1,5000 

Fog on 
Fog distance 600 
Fog color RGB(128,128,128) 
Color Backdrop RGB(128,128,128) 

set ambient light 40

Rem make matrix 
Make matrix 1,10000,10000,20,20 

Rem texture matrix 
Load image "bright01.bmp",1 
Prepare matrix texture 1,1,1,1 
Fill matrix 1,0,1 

rem Randomize the matrix 
randomize matrix 1,125

rem load your music
load music "Field.mid",1
play music 1
loop music 1

rem load sound
load sound "rain.wav",1
play sound 1
loop sound 1

rem load sound 2
load sound "wind.wav",2
play sound 2
loop sound 2

Rem Main loop 
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 
  XTest# = Newxvalue(X#,CameraAngleY#,10) 
  ZTest# = Newzvalue(Z#,CameraAngleY#,10) 
  If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 
   X#=XTest# 
   Z#=ZTest# 
  Endif 
 Endif 

 If Downkey()=1 
  XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-180),10) 
  ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),10) 
  If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 
   X#=XTest# 
   Z#=ZTest# 
  Endif 
 Endif 
  
 If Leftkey()=1 
  XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10) 
  ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10) 
  If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 
   X#=XTest# 
   Z#=ZTest# 
  Endif 
 Endif 

 If Rightkey()=1 
  XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#+90),10) 
  ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#+90),10) 
  If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000 
   X#=XTest# 
   Z#=ZTest# 
  Endif 
 Endif 

 Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24) 
 Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24) 
  

 Y# = Get ground height(1,X#,Z#) 
 Position Camera X#,Y#+50,Z# 

 Rem Refresh Screen 
 Sync 
Loop