http://img12.imageshack.us/i/fpswrong.png/
When I load my program this is what I see. Collision works perfectly even though I can't see walls but they are not textured. What's my problem?
I have tried both
rem load static objects "levelbank/testlevel/universe.dbo",0
load object "levelbank/testlevel/universe.dbo",level : rem hide object 1
and
load static objects "levelbank/testlevel/universe.dbo",0
load object "levelbank/testlevel/universe.dbo",level : hide object 1
Here's my full code (Sparky's Collision)
sync on
sync rate 60
`````````Globals`````````````
Global player = 2
Global level = 1
Global playerYColl# = 0
Global playerYNorm# = 0
Global falling = 1
Global plrSpeedF# = 0
Global plrSpeedR# = 0
Global moving = 0
Global canJump = 0
Global jumping = 1
Global gravity# = 0.0
`````````````````````````````
`````````LOAD LEVEL``````````
set dir "Files"
rem load static objects "levelbank/testlevel/universe.dbo",0
load object "levelbank/testlevel/universe.dbo",level : rem hide object 1
make object cylinder player,50
position object player,3600,125,-360
rotate camera 0,140,0
`````````````````````````````
`````````SETUP Collision`````
sc_setupcomplexobject level,1,2
sc_setupobject player,0,2
`````````````````````````````
do
x$ = str$(camera position x())
y$ = str$(camera position y())
z$ = str$(camera position z())
text 0,0,x$
text 0,50,y$
text 0,100,z$
text 0,150,"Y Norm: " + str$(playerYNorm#)
text 0,200,"Y Diff: " + str$(playerYColl#)
text 0,250,"canJump: " + str$(canJump)
moveplayer()
sync
loop
function moveplayer()
rem Old positions
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
rem Input Conrols
if keystate(17)=1 then inc plrSpeedF#, 0.1
if keystate(31)=1 then dec plrSpeedF#, 0.1
if keystate(17)=0 and keystate(31)=0
if plrSpeedF# > 0
dec plrSpeedF#, 0.1
if plrSpeedF# < 0 then plrSpeedF# = 0
endif
if PlrSpeedF# < 0
inc plrSpeedF#, 0.1
if plrSpeedF# > 0 then plrSpeedF# = 0
endif
endif
if keystate(32)=1 then inc plrSpeedR#, 0.1
if keystate(30)=1 then dec plrSpeedR#, 0.1
if keystate(32)=0 and keystate(30)=0
if plrSpeedR# > 0
dec plrSpeedR#, 0.1
if plrSpeedR# < 0 then plrSpeedR# = 0
endif
if PlrSpeedR# < 0
inc plrSpeedR#, 0.1
if plrSpeedR# > 0 then plrSpeedR# = 0
endif
endif
if keystate(32)=1 or keystate(30)=1 or keystate(17)=1 or keystate(31)=1
moving = 1
else
moving = 0
endif
rem Control jumping
if spacekey() = 1 and canJump = 1
jumping = 1
gravity# = 3.0
endif
if jumping = 1
gravity# = gravity# - 0.1
endif
if gravity# < -5.0 then gravity# = -5.0
rem Control Cap
if plrSpeedF# > 2 then plrSpeedF# = 2
if plrSpeedF# < -2 then plrSpeedF# = -2
if plrSpeedR# > 2 then plrSpeedR# = 2
if plrSpeedR# < -2 then plrSpeedR# = -2
rem Finalize movement
move object right 2, plrSpeedR#
move object 2, plrSpeedF#
position object 2, object position x(2), object position y(2)+gravity#, object position z(2)
x# = object position x(2)
y# = object position y(2)
z# = object position z(2)
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,30,0)
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
if sc_getCollisionNormalY() > 0.3
jumping = 0
gravity# = 0.0
canJump = 1
else
canJump = 0
jumping = 1
endif
if sc_getCollisionNormalY() < -0.7 then gravity# = 0
playerYColl# = y# - sc_getStaticCollisionY()
else
canJump = 0
jumping = 1
endif
position object 2,x#,y#,z#
playerYNorm# = sc_getCollisionNormalY()
rem position the camera
position camera object position x(2),object position y(2),object position z(2)
rem camera control/player movement
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
cx#=camera angle x(0) : cy#=camera angle y(0)
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
yrotate object 2,camera angle y()
position camera 0, camera position x(), camera position y()+20, camera position z()
endfunction
rem ###########
if memblock exist(1) then delete memblock 1
rem ###########
ALSO, can someone direct me to a tut or page on how to make camera cinematic? I don't know exactly what they are called but it's well the camera goes a set path without user control to add a "cinematic moment" effect.
Ventures of the worlds around us are only limited by imagination.