I'm having a little problem with the animation code of the player sprite. Can anyone see whats wrong with it. The sprite does the wrong animation for jump and doesn't perform the shoot animation at all. I'll post everything after I get this problem fixed.
for b = 1 to array count(physBox())
`current player sprite frame
curPframe = sprite frame(10+b)
`current player blood sprite frame
curPBframe = sprite frame(60)
`Control Sprite Animation when Player's Alive
if alive=1
if leftkey() then addForce(1,270,6*time#):move=1:Angleo#=270
if rightkey() then addForce(1,90,6*time#):move=2:Angleo#=90
if leftkey()=0 and rightkey()=0 then move=0
if move=1 and face=2 then flip sprite 10+b:face=1
if move=2 and face=1 then flip sprite 10+b:face=2
if move > 0 and move < 3
play sprite 10+b,1,6,50
endif
`Idle Animation
if move=0 and jump=0
play sprite 10+b,7,10,50
endif
`Jumping
if keystate(30)=1
if jump=0
jump=1
addForce(1,180,10)
endif
endif
if jump=1
play sprite 10+b,28,31,50
if curPframe=31 then curPframe=31
inc jumptimer
if jumptimer>50 then jump=0:jumptimer=0
endif
if keystate(31)=1 then shoot=1 else shoot=0
if shoot=1
play sprite 10+b,18,22,50
endif
if shiftkey()
alive = 0
alivetimer=100
curPbframe=1
endif
endif
`Controls Sprite Animation when Player's dead
if alive=0
if alivetimer>=0 and curPframe<18 then play sprite 10+b,11,18,50
if curPframe=18 then curPframe=18
`Blood Sprite
if alivetimer>=0 and curPBframe<16 then play sprite 60,1,16,50
if curPbframe=16 then curPbframe=16
`Timer
if alivetimer>0 then dec alivetimer
if alivetimer<=0 then alive=1:alivetimer=0
endif
next b
EDIT:I think I figured the problem out with using the 'set sprite frame'