not really a new comer but i figured this the best way to get my newbie questions answered. BTW im working with DBPro
i was making a monster object when the problem aroused itself. he was idle for a while but then i appended a dying animation. here is my whole shooting snippet along with the enemydead variable i made.
when i ran this and shot the monster he stopped the idle animation then froze in a position that looked like frame 26 or the first frame of the dying animation.whats wrong with my code? is there something else other thatn "play object" that i could use??
rem shoot bullet
if mouseclick()=1
`safety flag incase you hold mouse 1 down
if mouse1pressed = 0
`turn saftey flaf on
mouse1pressed = 1
`flag to control bullet firing
if bulletfiring = 0
`turn firing flag on
bulletfiring = 1
set object to object orientation 2,1
show object 2
endif
endif
else
`reset mouse 1 safety flag when not pressed
mouse1pressed = 0
endif
`if bullet firing flag is 1 then fire bulet
if bulletfiring = 1
move object 2,10
`if bullet firing flag not 1 then hide bullet and
`position the bullet at the players location
else
if object visible(2) = 1 then hide object 2
`make sure and put the # sign after float variables
`they were missing in your code
position object 2,x1#,y1#,z1#
endif
`get the distance from the player to the bullet
Bulletdist# = sqrt(((x1#-x2#)*(x1#-x2#))+((y1#-y2#)*(y1#-y2#))+((z1#-z2#)*(z1#-z2#)))
`if the distance is 100 units end bullet firing
`you can also add collision to stop it when you have enemys
if Bulletdist# >= 100
bulletfiring = 0
endif
loop object 3,1,25
if object collision (2,3)
enemydead=1
endif
if enemydead=1
play object 3,26,76
please help
btw idle = 1-25
dying = 26-76