ok simple question, i have this here program (attached with media)
Rem Project: Conphewz
Rem Created: Wednesday, April 28, 2010
Rem ***** Main Source File *****
sync on
sync rate 60
autocam off
set image colorkey 255,0,255
color backdrop 0
global radius# as double float : radius# = 10.0
makelevel()
makeplayer()
`player movement vector
global vx# as double float
global vy# as double float
global vz# as double float
global gravity# as double float : gravity# = -0.1
global slope# as double float : slope# = 0.5
global ground as integer : ground = 1
`Start main loop
do
POINT CAMERA X#,Y#,Z#
moveplayer()
`Debug information
set cursor 0,0
print "x:";object position x(2)
print "y:";object position y(2)
print "z:";object position z(2)
print "camera x:";camera position x(0)
print "camera y:";camera position y(0)
print "camera z:";camera position z(0)
sync
loop
function makelevel()
load object "Levels\Simple.x",1
set object cull 1,0
sc_setupcomplexobject 1,1,2
MAKE OBJECT CYLINDER 3,20
POSITION OBJECT 3,90,17,3
ghost object on 3
position camera x#,150,z#-150
endfunction
function makeplayer()
Load object "Levels\Sphere.x",2
position object 2,-90,135,-30
sc_setupobject 2,0,1
sc_allowobjectscaling 2
SC_DRAWOBJECTBOUNDS 2
endfunction
function moveplayer()
yrotate object 2,object angle y(2)+mousemovex()/3
xrotate object 2,object angle x(2)+mousemovey()/3
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
angy# = object angle y(2)
vx# = 0
vz# = 0
if vy#=0 then vy# = vy# + 10*gravity# else vy# = vy# + gravity#
if z#=<25
if keystate(32)=1 then vx# = vx# + cos(angy#) : vz# = vz# - sin(angy#)
if keystate(30)=1 then vx# = vx# - cos(angy#) : vz# = vz# + sin(angy#)
if keystate(31)=1 then vx# = vx# - sin(angy#) : vz# = vz# - cos(angy#)
if keystate(17)=1 then vx# = vx# + sin(angy#) : vz# = vz# + cos(angy#)
endif
x#=oldx#+vx#
y#=oldy#+vy#
z#=oldz#+vz#
collide = sc_spherecastgroup(1,oldx#,oldy#,oldz#,oldx#,oldy#+vy#,oldz#,radius#,0)
if collide>0
ny# = sc_getCollisionNormalY()
if abs(ny#)>slope#
`Flat ground
oldy# = sc_getStaticCollisionY()
else
`Steep slope, cause to slide
x# = x# - oldx# : z# = z# - oldz#
oldx# = sc_getCollisionSlideX()
oldy# = sc_getCollisionSlideY()
oldz# = sc_getCollisionSlideZ()
x# = x# + oldx# : z# = z# + oldz#
endif
`ny#<0 means the player has hit a ceiling rather than a floor
if ny#>slope#
`only on ground if standing on flat ground
ground = 1
vy# = 0
else
ground = 0
`If player has hit a flat ceiling then stop vy# movement
if ny#<-slope# then vy# = gravity#
endif
else
`Nothing below player, not on ground, add vertical speed to player
oldy# = oldy# + vy#
ground = 0
endif
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,oldy#,z#,radius#,0)
if collide>0
`If hit, reposition player, stop movement
x# = sc_getCollisionSlideX()
oldy# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
vx# = 0
vz# = 0
endif
if object exist (3)
if object collision (2,3)>0
sync on
for s=100 to 25 step -1
scale object 2,s,s,s
if s=25 then delete object 3
radius#=2.5
sync
next s
endif
endif
position object 2,x#,oldy#,z#
sc_updateObject 2
if oldy#=<-1000
delete object 2
sc_removeobject 2
makeplayer()
endif
if z#=>25
position camera x#,150,z#+150
else
position camera x#,150,z#-150
endif
if z#=>100 then wait 500 : end
endfunction
all i want to do quite simple is when the camera changes view i want the controls to reverse with it, i have tried a few ways, but they don't really seem to work
*edit*
by the way if you do have a look at the thing running, you need to hit the ghost cylinder first, and there are alot of controls in the programming that i was tryng, but didn't use but haven't taken them out yet, eg: the mouse.
Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD
I can see from your smile, you're not here for the sunset.