I Made A Simle Game Out Of The Demo:
My Highscore: 6141
`Modified By Ilya(Ilsoft On The TheGameCreator's Forums
` Advanced Terrain System - Example 1
` sky textures from - SkyMatter
` heightmap created by - David Smith ( infiniteloop@optushome.com.au )
` terrain base texture - generated from Advanced Terrain System Plus
randomize timer()
` demo by - TGC
` set up display and camera
flood=0
floodh=0
sync on
backdrop on
autocam off
set camera range 0.5, 30000
` movement
g_fSpeed# = 0.5
g_fTurn# = 0.3
` set the directory to media
set dir "media"
` load base and detail texture
load image "texture.bmp", 1
load image "detail.tga", 2
load image "lava.bmp",3
make object box 1,100,0.01,100
position object 1, 0,29,0
scale object 1, 30000, 30000, 30000
color object 1,0
make object terrain 5 ` create the terrain object
set terrain heightmap 5, "map.bmp" ` set the heightmap
set terrain scale 5, 3, 0.6, 3 ` set the scale
set terrain split 5, 16 ` split value by 16 * 16
set terrain tiling 5, 4 ` detail map tiling
set terrain light 5, 1, -0.25, 0, 1, 1, 0.78, 0.5 ` light - xdir, ydir, zdir, red, green, blue, intensity
set terrain texture 5, 1, 2 ` base and detail texture
build terrain 5 ` finally build the terrain
` load our skybox
load object "skybox2.x", 200
set object light 200, 0
set object texture 200, 3, 1
position object 200, 1000, 2000, 4000
scale object 200, 30000, 30000, 30000
` reset the directory
set dir ".."
` position the camera
position camera 385,23,100
` main program loop
`position camera object position x(1),object position y(1),object position z(1)
endtime = 0
set cursor 0, 0
do
restart:
if i=>1 then if camera position y () < object position y (1) and flood=0 then endgame=1
if camera position y () < object position y (1) and flood=0 then print "End Of The Game"
i=i+1
if endgame=1 then gosub endgame
if endgame=0 then endtime=endtime+1
if flood=1
if object position y (1) < floodh then position object 1, 0,object position y(1)+0.1,0
if object position y (1) > floodh then position object 1, 0,object position y(1)-0.1,0
if stop# = object position y (1) then flood=0
endif
stop# = object position y (1)
`rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
`if upkey()=1 then move camera 0,0.2
`if downkey()=1 then move camera 0,-0.2
`if spacekey()=1 then scale object 2,object size x(2)+10000,object size y(2)+10000,object size z(2)+10000
` handle user input and show some stats
gosub userInput
gosub information
` get the height of the terrain at the current camera position
a# = get terrain ground height( 5, camera position x( ), camera position z( ) )
` now position the camera slightly above the terrain
position camera camera position x( ), a# + 3, camera position z()
` let the terrain handle some internal work
update terrain
` final screen update
sync
if flood=0 then chance=rnd(250)
if chance=3
chance=0
flood=1
floodh=rnd(110)
endif
loop
userInput:
` simple mouse and keyboard movement
` move around with arrow keys
control camera using arrowkeys 0, g_fSpeed#, g_fTurn#
` store old camera angle
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
` store new camera angle
CameraAngleY# = wrapvalue ( CameraAngleY# + mousemovex ( ) * 0.4 )
CameraAngleX# = wrapvalue ( CameraAngleX# + mousemovey ( ) * 0.4 )
` rotate camera
yrotate camera curveangle ( CameraAngleY#, OldCamAngleY#, 24 )
xrotate camera curveangle ( CameraAngleX#, OldCamAngleX#, 24 )
` speed up movement
`if inkey$ ( ) = "a" then position object 1, 0,object position y(1)+0.1,0
` slow down movement
`if inkey$ ( ) = "z" then position object 1, 0,object position y(1)-0.1,0
return
information:
` show some information
` start printing at top of screen
` set cursor 0, 0
` show frame rate
` print "fps = " + str$ ( screen fps ( ) )
` print ""
` current camera position
` print ""
` print "x = " + str$ ( camera position x ( ) )
` print "y = " + str$ ( camera position y ( ) )
` print "z = " + str$ ( camera position z ( ) )
`print ""
` finally the polygon count
` print "polygon count = " + str$ ( statistic ( 1 ) )
` print ""
if flood=1 then print "WARNING! Flood Occoring! Hight: "+str$ (floodh) +"!!!!"
print "Your Hight: "+str$(camera position y())+"."
if flood=1 and camera position y()<floodh then print "WARNING! THE FLOOD WILL KILL YOU!!! FIND HIGHER GROUND!!!"
return
endgame:
if endtime < 100 then endgame$ = "Your Score("+str$ (endtime)+ ")Sucks."
if endtime < 1000 and endtime > 99 then endgame$ = "Your Score: "+str$ (endtime)+ "."
if endtime < 3000 and endtime > 999 then endgame$ = "Good. Score: "+str$ (endtime)+ "."
if endtime < 6000 and endtime > 2999 then endgame$ = "Very Good. Score: "+str$ (endtime)+ "."
if endtime > 6000 and endtime < 12000 then endgame$ = "Excellent. Score: "+str$ (endtime)+ "."
if endtime > 12000 then endtime$ = "Impossible. Score: "+str$ (endtime)+ "."
print endgame$
print "Press Space To Play Again."
if spacekey()=1
flood=0
position object 1,0,29,0
position camera 385,23,100
i=0
floodh=0
endgame=0
endtime=0
goto restart
endif
return
The Point Is To Not Sink In The Tar(Grey Stuff) For As Long As You Can. Your Score Is In Miliseconds. You Can Swim In Tar If There Is A Flood. If The Flood Stops, You Die. That Means You Can't Get To The Highest Island Before A Flood Occors. This Game Is Mostly About Luck.
EDIT Oh And I Used A Custom Hieghtmap. Just Put It In The Media Folder In The Advanced Terrain Folder In The Help Folder In Your DBPro Folder:
http://ilsoft.phoenixrising-web.com/map.bmp. You Need It To Get An Official Score. Remember To Backup The Existing One.
-Ilya