Thanks, Jason, but I need to at least get my program to work.
Then I can worry about optimization and structure.
I'll refer to that later though.
No luck on my end as far as getting it to animate. I've switched loop object with play object, but it still doesn't work.
Here's what I have:
Function PlayerMove(model as Integer, coreObject as Integer, coX# as Float, coY# as Float, coZ# as Float)
REM If player is moving, animate it
if object playing(model)=0
play object model, 173,173
endif
if player_state = 1
play object model,1,150
else
play object model, 173,173
endif
` get the position of object 4
x# = object position x ( model )
y# = object position y ( model )
z# = object position z ( model )
rem Move player (eight-directional movement)
If Downkey()=1 AND Leftkey()=1
`yrotate object model,45
yrotate object model,curveangle(45,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Downkey()=1 AND Rightkey()=1
`yrotate object model,-45
yrotate object model,curveangle(-45,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Upkey()=1 AND Leftkey()=1
`yrotate object model,135
yrotate object model,curveangle(135,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Upkey()=1 AND Rightkey()=1
`yrotate object model,-135
yrotate object model,curveangle(-135,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Upkey()=1
`yrotate object model,180
yrotate object model,curveangle(180,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Downkey()=1
`yrotate object model,360
yrotate object model,curveangle(360,object angle y(model),10)
phy move character controller model, -50.0
`Move Object model,10
player_state=1
else
If Leftkey()=1
`yrotate object model,90
yrotate object model,curveangle(90,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
If Rightkey()=1
`yrotate object model,270
yrotate object model,curveangle(270,object angle y(model),10)
phy move character controller model, -50.0
player_state=1
else
player_state=0
endif : endif : endif: endif : endif : endif : endif : endif
phy move character controller model, 1 : phy move character controller model, -1
// Gravity Commands
Player.vY = Player.vY + MY_GRAVITY
x# = Player.X + Player.vX
y# = Player.Y + Player.vY
z# = Player.Z + Player.vZ
`Position Object model,x#,y#,z#
print "player state = ",player_state
print "Is char animating? ",object playing(model)
rem END directional movement----------------------------------------------------
Endfunction
HELP would be greatly appreciated!
Currently working on - Enemy AI and Action Battle System
the sig limit needs to be raised...