using dbpro
cannot get camera to move up and down could use some help
have been workin on it for several weeks with no luck.
SET DISPLAY MODE 1280,1024,32
hide mouse
color backdrop 0,1
set ambient light 100
`Load objects and textures
load image "gun.jpg",8
LOAD OBJECT "EXPORT.x",3
load object "bathroom.x",1
load object "cube.x",6
load object "apache\apache2.x",9
`size helocoptor and position it
scale object 9,40,40,40
position object 9,1000,-50,0
xrotate object 9,-90
`load gun position gun
LOAD OBJECT "gun.x",5
texture object 5,8
`glue gun to hand
glue object to limb 5,3,60
move object left 5,.11
move object down 5,.1
scale object 5,.6,.6,.6
roll object right 5,90
yrotate object 5,90
`set up skybox
position object 6,0,-70,0
scale object 6,2000,2000,2000
`size house
position object 1,0,-70,0
scale object 1,30,30,30
`set characters speed
set object speed 3,70
`size character
scale object 3,6000,6000,6000
`initil player start position
YROTATE OBJECT 3,180 : FIX OBJECT PIVOT 3
position object 3,0,0,0
Do
center text object screen x(3),object screen y(3),("amus:")+("level 1")
obplay#= object playing(3)
`stop character if key is realeased
if keystate(17)=0
if obplay# =1
stop object 3
endif
endif
`if key is press and object is playing continue with loop
if obplay# =1
gosub obplay:
endif
`play object
if keystate(17)=1
play object 3,72,96
endif
obplay:
`load heath menu
load image "menu.bmp",2
sprite 2,910,935,2
set sprite alpha 2,220
`load crosshair
load image "crosshair.bmp" ,1
sprite 1,625,498,1
`player movement controls
If keystate(17)=1
Move object 3,12
Endif
if keystate(31)=1
move object 3,-12
endif
`show fps
Fps#=screen fps()
text 0,40,str$(Fps#)
`color text
ink rgb (0,0,225),0
set text to bold
set text size 30
text 1215,980,""
`print mouse move x distace
Mousex#=MOUSEMOVEX()
TEXT 0,0,STR$(Mousemovex#)
SET TEXT SIZE 20
AngleY# = object angle Y(3)+Mousex#/3
` y rotate obect using mouse
Yrotate object 3,Wrapvalue(AngleY# )
X# = Object position x(3)
Z# = Object position z(3)
`udeate object position
Position object 3,X#,Y#+12.5,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,100)
CameraX# = Newxvalue(X#,AngleY#-180,100)
`position camera to charater positioon
Position camera CameraX#,CameraY#+170,CameraZ#
Point camera X#,110,Z#
Loop
A child's dream never dies.