I have a game that I created using FPS Creator and then imported it into DBPro. After trying many times I couldn't position the camera where the start of the level is. The camera spawns below the level, I just can't get the camera into it. Any help would be appreciated.
Here is my current code:
Rem Project: Maze VI
Rem Created: Wednesday, April 29, 2015
set display mode 800,600,32
ink rgb(255,255,255),0 : set text font "arial" : set text size 15
center text 400,562,"Maze Game by Travis Schauer and Matt Weidner"
sync
do
x=scancode() : if Keystate(x)=1 then gosub MainSection
sync
loop
MainSection:
set dir "files"
load static objects "levelbank\testlevel\universe.dbo",0
position camera 50,50,50
p1X# = camera position X(0)
p1Y# = camera position y(0)
p1Z# = camera position Z(0)
print "Y position: " ; p1y# ; " | " ; camera position y(0)
print "X position: " ; p1X# ; " | " ; camera position X(0)
print "Z position: " ; p1Z# ; " | " ; camera position Z(0)
do
control camera using arrowkeys 0,1,2
loop
And here is the entire game folder:
https://drive.google.com/folderview?id=0B5kLgn-x_D4HflZheEVBM1lTR2FiazRMRzg0MFpScTRrQVFmQ1BNTVg4Wi14QVRHRFpPdjA&usp=sharing
Update:
I was able to figure it out by using the lovely search function.
Here is my code now:
Rem Project: Maze VI
Rem Created: Wednesday, April 29, 2015
set display mode 800,600,32
sync rate 60
ink rgb(255,255,255),0 : set text font "arial" : set text size 15
center text 400,562,"Maze Game by Travis Schauer and Matt Weidner"
sync
do
x=scancode() : if Keystate(x)=1 then gosub MainSection
sync
loop
MainSection:
set dir "files"
load static objects "levelbank\testlevel\universe.dbo",0
position camera 550,555,-50
rotate camera 0,180,0
p1X# = camera position X(0)
p1Y# = camera position y(0)
p1Z# = camera position Z(0)
print "Y position: " ; p1y# ; " | " ; camera position y(0)
print "X position: " ; p1X# ; " | " ; camera position X(0)
print "Z position: " ; p1Z# ; " | " ; camera position Z(0)
do
control camera using arrowkeys 0,1,2
loop
However I do have a few questions.
My first one would be using my above code, how do I get the X, Y, and Z positions to update while the camera moves?
Is it possible to make the objects that I loaded into DBPro from FPS Creator have collision so the camera does not go through them?
Thanks,
Travis