I've made great progress in one day, and am feel prety good bout my self LOL. I want to code a basic shooting range.
I'm stuck of keepping the camera's "feet" on the ground,
I'm sure this code is sloppiest ever, but I'm greatfuly for any suggestions THX GENTS!
Rem Project: beta test
Rem Created: 8/7/2006 12:58:35 PM
Rem ***** Main Source File *****
rem Standard Setup Code for all examples
sync on : sync rate 0 : color backdrop 0
set text font "arial" : set text size 16
set text to bold : set text transparent
rem Make Simple Terrain
TerrainNumber=1
make terrain TerrainNumber,"land1.bmp"
position terrain TerrainNumber, 0,-10 ,1024
rem Texture terrain
ImageNumber=1
load image "CYGRASS1.bmp",ImageNumber
texture terrain TerrainNumber,ImageNumber
size#=2048
rem Load sky object
load object "sky\sb.x",4
scale object 4,40,40,40
set object cull 4,0
set object light 4,0
set object texture 4,2,1
rem target
MAKE OBJECT BOX 3, 100, 70, 5
POSITION OBJECT 3, 400, 10, 0
SET OBJECT COLLISION TO POLYGONS 3
rem AK-47 load
LOAD OBJECT "ak47.3ds", 2
POSITION OBJECT 2,195,-6,0
Load sound "Gun 1.Wav", 1
rem Position camera in center of terrain
Make CAMERA 1
position camera 1, 250,6,250
Ammo#=100
rem Main loop
desc$="LOD Terrain from Bitmap"
while ESCAPEKEY()=0
SET CAMERA TO OBJECT ORIENTATION 1, 2
rem shooting
IF MOUSECLICK()=1
Ammo#=Ammo#+1
PLAY SOUND 1
MAKE OBJECT CUBE Ammo#, 5
SET OBJECT COLLISION TO BOXES Ammo#
POSITION OBJECT Ammo#, cx#,cy#,cz#
MOVE OBJECT Ammo#, 500
wait 100
ENDIF
print Ammo#
rem Control camera over terrain
control camera using arrowkeys 1,.2,0
cay#= cay# + mousemovex()
cay#=wrapvalue(cay#)
yrotate camera 1, cay#
cax#= cax# + mousemovey()
cax#=wrapvalue(cax#)
xrotate camera 1, cax#
cx#=camera position x(1)
cz#=camera position z(1)
cy#=camera position y(1)
position object 2, cx#, cy#-1,cz#+1
cax#=CAMERA ANGLE X(1)
cay#=CAMERA ANGLE Y(1)
caz#=CAMERA ANGLE Z(1)
ROTATE OBJECT 2, cax#,cay#, caz#
rem Position sky at player
position object 4,camera position x(0),camera position y(0)-150,camera position z(0)
rem Show Framerate
text 20,screen height()-40,desc$
fps$="DBPro Fps: "+str$(screen fps())
text screen width()-20-text width(fps$),screen height()-40,fps$
rem Update screen
sync
rem End loop
endwhile
rem Delete Terrain
delete terrain TerrainNumber