This will only accept unique key presses and will keep Pac-man moving constantly, I've remmed out the IF statement that will mean he only moves when a key is pressed.

Sorry to do all of it for you but I was interested in this
u=upkey() : r=rightkey() : d=downkey() : l=leftkey()
Pacman=1 : Pac_posX=object position x(Pacman) : Pac_posZ=object position z(Pacman)
if u>r+d+l then Pac_dirX=0 : Pac_dirZ=+1 : Pac_angY=0
if r>d+l+u then Pac_dirX=+1 : Pac_dirZ=0 : Pac_angY=90
if d>l+u+r then Pac_dirX=0 : Pac_dirZ=-1 : Pac_angY=180
if l>u+r+d then Pac_dirX=-1 : Pac_dirZ=0 : Pac_angY=270
rem if u+r+l+d = 1
Pac_posX=Pac_posX+Pac_dirX : Pac_posZ=Pac_posZ+Pac_dirZ
rem endif
yrotate object Pacman,Pac_angY
Position object Pacman,Pac_posX,5,Pac_posZ
I've just made this up in the post so there's no guarantee it will work
[EDIT]
Got the Z direction the wrong way around but apart from that it works fine
Here's a fully functional version:
`-------------------------
`* 3D Pac-Man example
`* By OBese87
`-------------------------
make object cone 1,10
xrotate object 1,90 : fix object pivot 1
matX=200 : matZ=200
make matrix 1,matX,matZ,10,10
position camera matX/2,matZ,-50
hide mouse
sync on
`---------------------------
` MAIN LOOP
`---------------------------
DO
u=upkey() : r=rightkey() : d=downkey() : l=leftkey()
Pacman=1 : Pac_posX=object position x(Pacman) : Pac_posZ=object position z(Pacman)
if u>r+d+l then Pac_dirX=0 : Pac_dirZ=+1 : Pac_angY=0
if r>d+l+u then Pac_dirX=+1 : Pac_dirZ=0 : Pac_angY=90
if d>l+u+r then Pac_dirX=0 : Pac_dirZ=-1 : Pac_angY=180
if l>u+r+d then Pac_dirX=-1 : Pac_dirZ=0 : Pac_angY=270
rem if u+r+l+d = 1
Pac_posX=Pac_posX+Pac_dirX : Pac_posZ=Pac_posZ+Pac_dirZ
if Pac_posX<0 then Pac_posX=0
if Pac_posZ<0 then Pac_posZ=0
if Pac_posX>matX then Pac_posX=matX
if Pac_posZ>matZ then Pac_posZ=matZ
rem endif
yrotate object Pacman,Pac_angY
Position object Pacman,Pac_posX,5,Pac_posZ
point camera Pac_posX,5,Pac_posZ
sync
LOOP
I'm pleased with this, my code has improved so much since joining the forums
If you have any questions about my code please ask.
I will explain a clever trick I have used that I picked up from someone.
if u>r+d+l then Pac_dirX=0 : Pac_dirZ=+1 : Pac_angY=0
this line of code is doing the same as
if upkey()=1 and rightkey()=0 and downkey()=0 and leftkey()=0 then then Pac_dirX=0 : Pac_dirZ=+1 : Pac_angY=0
If you are using lots of ANDs and/or ORs (

) then try to think of ways to do the same statement mathematically
Your signature has been erased by a mod because it was rubbish.
