Hi, im havin a bit of trouble with the movement of my character:
When i press right or left i want my character to move around the camera and to face in the direction in which it is moving.
Here is my code, incase you need it:
Rem Initalise
sync on
sync rate 60
autocam off
hide mouse
set camera range 1,10000
set ambient light 60
set dir "C:\Ninja\Media"
Rem character
load object "Ninja.x",1
load image "Ninja (1).dds",1
Texture object 1,1
scale object 1,400,400,400
Rem Matrix
make matrix 1,2000,2000,50,50
load image "grass.bmp",2
prepare matrix texture 1,2,1,1
Rem Load SkySphere
load object "skysphere\vd.x",2
set object cull 1,3
position object 1,200,0,200
Do
x# = object position x(1)
z# = object position z(1)
y# = get ground height(1,x#,z#)
aY# = object angle y(1)
position object 1,x#,y#,z#
position object 2,x#,y#,z#
cx# = camera position x()
cz# = camera position z()
cy# = get ground height(1,cx#,cz#)
`set camera to follow x#,y#,z#,aY#-180,20,8,1,1
position camera x#+10,y#+10,z#+10
point camera x#,y#,z#
If Upkey() = 1
point object 1,cx#,cy#,cz#
move object 1,-1
Endif
If Downkey() = 1
point object 1,cx#,cy#,cz#
Turn object left 1,180
move object 1,-1
Endif
set object speed 1,80
If Upkey() = 1 or Downkey() = 1
loop object 1,6
Else
Set object frame 1,0
Endif
sync
loop
Im not quite shure you`ll understand what i mean but its difficult to describe. If anyone can help it would be much appreciated.