I want to make my character (well, a sphere...) roll forwards by rotating it away from me. I have a camera in third person view. At the moment I have it rotating on its x axis, which is fine as long as you dont have him moving in any direction other than a straight line along the z direction thing (I think that's the one)...
Anyway, is there a way of making him roll depending on where he's facing?
I've put my source here for reference:
Sync On
Rem make character
Make Object Sphere 1,20
position object 1,0,25,0
Make Object Sphere 2,50
position object 2,0,25,0
ghost object on 2
Rem Create matrix
Make Matrix 1,2000,2000,50,50
Do
Rem Store the object's Y angle in aY#
aY# = Object angle Y(1)
Rem Store the 2nd object's angles for rolling
objax#=object angle x(2)
objay#=object angle y(2)
objaz#=object angle z(2)
Rem Control input
If Upkey()=1
Move object 1,2
xrotate object 2,wrapvalue(objax#+10)
yrotate object 2,wrapvalue(objay#+10)
zrotate object 2,wrapvalue(objaz#+10)
Endif
If Rightkey()=1 then aY# = Wrapvalue(aY#+5)
If Leftkey()=1 then aY# = Wrapvalue(aY#-5)
Rem rotate the sphere
Yrotate object 1,aY#
Rem get object position
X# = object position x(1)
Y# = object position y(1)
Z# = object position z(1)
Rem position camera
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Position Camera cX#,70,cZ#
point camera X#, Y#, Z#
Rem position visible ball
position object 2,X#,Y#,Z#
Rem Refresh Screen
Sync
Loop
*EDIT: I'm using DBC btw*
Am I the only one here who's really confused?