TGC Codebase Backup



Cruiser by Vusay

11th Jun 2004 14:31
Summary

This Is just a little boat simulator you might want to mess about with.



Description

This is a 2% complete version of my next game Cruiser. I'm not going to hand out my whole game so I'll just gie you this before It starts getting good. Hope you like it.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    sync on:sync rate 40

ss=15000


rem Define scene size
maxsize=2900

wh#=2
speed#=0
i#=1
speedo#=(speed#*-4.0)+60.0


`setup scene
load object "boat.x",1
load object "wheel.x",7
load object "sun.x",18
load image "sun.bmp",19
load object "animal2.x",15
load object "needle.x",8
position object 7,1,1,1

scale object 7,500,500,500
scale object 1,70,70,70
make matrix 1,maxsize*3,maxsize*3,50,50
load image "sky.bmp",3,2
load image "sea1.bmp",1,2
load image "back.bmp",5
sprite 1,1,400,5
paste image 5,1,1
prepare matrix texture 1,1,1,1
dim waves(20,20)
for i=0 to 20
	for l=0 to 20
		waves(i,l)=(rnd(72))*5
	next l
next i
wave_height#=2.7
if fog available()=1
	fog on : fog distance 3500 : fog color rgb(255,255,255) : fogdepth#=45000
endif

`ghost matrix on 1
set matrix wireframe off 1
make object sphere 2,maxsize*3
set object 2,1,1,0
texture object 2,3
fade object 2,0
scale object 2,100,30,100
Load image "waves1.bmp",2
position object 2,maxsize,0,maxsize
make matrix 2,maxsize,maxsize,50,50
position matrix 1,1,1,2
position matrix 2,1,-8,2
prepare matrix texture 2,1,1,1
ghost matrix on 2
texture object 18,19
make matrix 3,maxsize,maxsize,50,50
position matrix 3,1,-14,2
prepare matrix texture 3,1,1,1
ghost matrix on 3

point object 15,160,1,1
position object 15,1300,1.,1300
position object 1,1500,1,1500
position camera 1480,10,1500
rotate object 1,270,1,1






rem start loop
 do
 	
if keystate(3)=1 then lock object on 1

move object 15,0.5
`paste image 5,1,1
set sprite 1,1,1

set cursor 2,2
print speed#
set cursor 150,2
Print str$(Screen FPS())
set cursor 300,2
print speed#*23.65632



move object 1,speed#

scroll object texture 2,9,9


if speed#>1.0568
i#=0
else
i#=1
endif

if i#=1 and upkey()=1
speed#=speed#+0.0002*1.2
endif


if downkey()=1
speed#=speed#-0.0004
endif



if mouseclick()=1 then turn camera left 3
if mouseclick()=2 then turn camera right 3
if leftkey()=1 and speed#>0.00001
turn object left 1,speed#/2
endif
if rightkey()=1 and speed#>0.00001
turn object right 1,speed#/2
endif
if spacekey()=1 then move camera 3




for i=0 to 20
 		for l=0 to 20
 			set matrix height 1,i,l,sin(waves(i,l))*wave_height#
 			
 			rem diy wrapvalue since pro version fails after so long
 			if waves(i,l)<360
 				waves(i,l)=waves(i,l)+3
 			else
 				waves(i,l)=0
 			endif
 			
 		next l
 	next i
 	update matrix 1

 	sync
 loop