Firstly - never, ever,
ever post your age in an online forum.
Quote: "i have play animation (whatever the walking frames are)
in the do loop area but when i press the upkey (and hold) the animation does not play until i let go of it.
So basicly i whant the animation (walk) to happen while the upkey is pressed."
As I said before, if you do this:
Do
Play Object 1, AttackStartFrame, AttackFinalFrame
Sync
Loop
then only the first frame will show. If you do this (as I think you are doing):
Do
If Upkey() = 1
Play Object 1, AttackStartFrame, AttackFinalFrame
endif
Sync
Loop
then as long as the upkey is pressed, you set the animation to its first frame.
Use a variable to say whether the object is walking or not:
ObjectWalking = 0
Do
If Upkey() = 1 and ObjectWalking = 0
Loop Object 1, AttackStartFrame, AttackFinalFrame
ObjectWalking = 1
else
ObjectWalking = 0
endif
Sync
Loop
Look at the code carefully and try to understand what's happening. At the start, the Swat character is idle - so set "ObjectWalking" to 0. In the main loop, the user presses the upkey so loop the walk animation - and set "ObjectWalking" to 1.
The next time the program loops around, "ObjectWalking" is already 1, so the object animation is already playing and the upkey input is ignored.
But, we have to reset it, so the "else" statement (for if the upkey isn't pressed) is that "ObjectWalking" is 0 - so next time it's pressed, we can start the animation again.
Now see if you can modify this to show the Idle animation if the upkey isn't pressed.
Hope this helps!
We spend our lives chasing dreams. Dark Basic lets us catch some of them.