Sorry,
here is the code
Rem Project: HookWare
Rem Created: 7/30/2005 9:35:56 PM
Rem Last Modified 3/06/2006
Rem Current Version: DarkBasic Professional 5.8
Rem (c) HookWare Games
Rem (c) Italy Portugal
Rem ***** Main Source File *****
`set up usual for 3D program
SYNC ON: SYNC RATE 60
BACKDROP ON: COLOR BACKDROP 0
AUTOCAM OFF: HIDE MOUSE
`set up basic collision for now
SET GLOBAL COLLISION ON
AUTOMATIC CAMERA COLLISION 0,1.5,1
`position camera
POSITION CAMERA 20,1.6,20
POINT CAMERA 200,50,200
`setup global variables
`jumping() contains jumping indicator and maximum jumping height.
DIM jumping(2)
`height() contains the ground height and player height and height collision
DIM height#(3)
`load media
load_media()
` make landscape
make_world()
`game loop
DO
`control camera
control_camera()
animate_objects()
`print variables
SET CURSOR 0,0
PRINT "position: ", CAMERA POSITION X(0)," ", CAMERA POSITION Y(0)," ", CAMERA POSITION Z(0)
PRINT "angle: ", CAMERA ANGLE X(0)," ", CAMERA ANGLE Y(0)," ", CAMERA ANGLE Z(0)
`update screen
SYNC
LOOP
FUNCTION load_media()
`load matrix texture
LOAD IMAGE "grass_T.BMP",1
`load wall texture
LOAD IMAGE "brick1_T.BMP",2
ENDFUNCTION
FUNCTION make_world()
`make a matrix
MAKE MATRIX 1,10000,10000,200,200
`texture matrix
PREPARE MATRIX TEXTURE 1,1,1,1
`position walls
RESTORE world
FOR y=1 TO 4
`read information
READ number,width#,height#,depth#,x#,y#,z#,texture
`make object
MAKE OBJECT BOX number,width#,height#,depth#
`position object
POSITION OBJECT number,x#,y#,z#
`texture objects
TEXTURE OBJECT number,texture
NEXT y
`-----position lights---------------------------------------------------------------------
`-----position static objects-------------------------------------------------------------
`-----position dynamic objects------------------------------------------------------------
ENDFUNCTION
`***********************************************
`* This function controls the use of the camera*
`***********************************************
FUNCTION control_camera()
`###############################################
`# LIST OF VARIABLES #
`###############################################
`# cx# = camera angle x #
`# cy# = camera angle y #
`# height#(1) = minimum height of the player #
`# height#(2) = current height of the player #
`# height#(3) = previous height of the player #
`# jumping(1) = variable for jumping #
`# jumping(2) = maximum height for jumping #
`# #
`# for more documentation see readme.txt #
`###############################################
`-----This controls the movement of the camera according to the mouse--------------------
ROTATE CAMERA CAMERA ANGLE X(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
`-----Control player movement------------------------------------------------------------
cx#=camera angle x(0) : cy#=camera angle y(0)
if keystate(17)=1 then xrotate camera 0,0 : move camera 0,0.2 : xrotate camera 0,cx#
if keystate(31)=1 then xrotate camera 0,0 : move camera 0,-0.2 : xrotate camera 0,cx#
if keystate(30)=1 then yrotate camera 0,cy#-90 : move camera 0.2 : yrotate camera 0,cy#
if keystate(32)=1 then yrotate camera 0,cy#+90 : move camera 0.2 : yrotate camera 0,cy#
`-----Make sure that the camera doesn't get to HUGE values when it is rotating------------
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
`-----make sure that the angle numbers do not exceed 360----------------------------------
yrotate camera 0,wrapvalue(camera angle y(0))
`-----Apply simple gravity to player------------------------------------------------------
`-----Get the minimum height possible for the player-----------------------------------
height#(1)=get ground height(1,camera position x(), camera position z())
`-----get the player's current height--------------------------------------------------
height#(2)=camera position y()
`-----apply the gravity----------------------------------------------------------------
height#(2) = height#(2)-0.1
`-----make sure the camera doesn't got through the matrix------------------------------
if height#(2)<height#(1)+1.5
height#(2)=height#(1)+1.5
endif
`-----time to start jumping--Before we start though, we need to make sure that------------
`-----the player is not already jumping, and has not reached the ground yet---------------
if jumping(1)<2
`-----press spacebar and jump-------------------------------------------------------------
if spacekey()=1
jumping(1)=1
jumping(2)=5
endif
endif
`-----now check if reached maximum height while jumping-----------------------------------
if jumping(1)=1 and height#(2)<jumping(2)
height#(2)=height#(2)+0.16
endif
`-----if above maximum, start dropping----------------------------------------------------
if height#(2)>jumping(2)
jumping(1)=2
endif
`-----when you land reset the jumping variable--------------------------------------------
if height#(2)=1.5
jumping(1)=0
endif
`-----when you land on an object, reset the jumping variable so you can jump off the object
if height#(3)=height#(2) and jumping(1)>0
jumping(1)=0
jumping(2)=jumping(2)+5
endif
`-----update the camera position----------------------------------------------------------
position camera camera position x(),height#(2),camera position z()
` make sure that you do not run off the edge of the matrix
if camera position x()<=0 then position camera 0,height#(2),camera position z()
if camera position x()>=10000 then position camera 10000,height#(2),camera position z()
if camera position z()<=0 then position camera camera position x(),height#(2),0
if camera position z()>=10000 then position camera camera position x(),height#(2),10000
`update the previous height variable
height#(3)=height#(2)
`end the function
ENDFUNCTION
FUNCTION animate_objects()
ENDFUNCTION
`uses boxes
`object number,width,height,depth,x,y,z,texture)
world:
data 1,100,8,1,50,4,99,2
data 2,100,8,1,50,4,1,2
data 3,1,8,100,99,4,50,2
data 4,1,8,100,1,4,50,2
`data 5,
`data 6,
`data 7,
`data 8,
hope this works better
Professor: "There is no such thing as absolute truth"
Student: "Is that always true?" "...Well..."
(c)HookWare Games (c) Italy Portugal