Hello, I have an animated object, I have made the movments with the animation, but my problem is the jumping, how do i do so that when I press spacekey and release the object play the jump animation even if the spacekey is released
My code in case
Rem Project: Ai
Rem Created: 13/05/2009 21:47:51
Rem ***** Main Source File *****
set display mode 1024,768,32
sync on
sync rate 60
hide mouse
autocam off
backdrop on
color backdrop 0,0
set camera range 0.5,1000000
global health as integer = 100
global player as integer = 1
make matrix 1,10000,10000,100,100
load object "tony/kham.x",player
scale object player,60,60,60
set object speed player,50
yrotate object player,180
fix object pivot player
Do
run=0
walk=0
gosub move_player
if walk=0 then loop object player,415,452
if walk=1 then loop object player,47,77
if walk=2 then loop object player,101,121
if walk=3 then loop object player,353,365
if walk=4 then loop object player,365,416
rem Move 47 - 77
rem Run 101-121
rem Idle 415-452
rem Jump 353-416
set camera to follow object position x(player),object position y(player),object position z(player),object angle y(player),250.0,150.0,30.0,1
update matrix 1
sync
loop
move_player:
speed# = 4.0
gosub animate_and_move_player
if controlkey()=1
speed#=speed#*2
gosub animate_and_move_player
if run=1
walk=2
endif
endif
return
animate_and_move_player:
if rightkey()=1
yrotate object player,wrapvalue(object angle y(player)+(speed#/2))
run=1
if controlkey()=0
walk=1
endif
endif
if leftkey()=1
yrotate object player,wrapvalue(object angle y(player)-(speed#/2))
if controlkey()=0
walk=1
endif
endif
if upkey()=1
move object player,speed#
run=1
if controlkey()=0
walk=1
endif
endif
if downkey()=1
run=1
move object player,-speed#
if controlkey()=0
walk=1
endif
endif
if spacekey()=1 && jump>0
walk=3
jump=1
inc jumpcount
endif
if spacekey()=0 and object frame(player)=365
inc jump
endif
print str$(object frame(player))
print jump
return
thanx for help