Hi there guys …it’s been a while !
I’m still busy with my platformer game “Kendrick and the sword of destiny” but I’ve hit a snag and I’m starting to think it could be a bug…or I’m just plain dumbass
I’ve created a new image\sprite and called it WeaponBtn (Touch Button). This button will be used for throwing daggers.
My animation for throwing daggers is player animation 3. When I use the keyboard key “s” everything works fine,but when I touch on the WeaponBtn it only does the first frame of animation 3. Below is the code…
Thanks in advance
Hard to tell, the code looks almost the same for both the key press and the touch button, but maybe there is more code that (doesn’t) run when you press the key or code that (doesn’t) run when you press the touch
I’ve been struggling for almost a week trying to figure out why it’s doing this. I’ve even tried to use variables for the throw action and animation.
It does seem to recognize the instruction of using player animation 3, which is the throw animation. Yet when it executes the instruction it only renders the first frame of the animation…very strange !
I’d throw in a Trigger once condition to the cursor/touch event. It may be that event is constantly resetting the animation to the first frame of animation 3, so you never get to see the others.
Another way to investigate would be to combine the last two events into one event that has an OR condition (found in Advanced) that acts on either the press of S or being over the button.
||If one of these conditions is true:
s key is pressed
cursor/touch is on WeaponBtn
The object KnifeIcon is visible
With the action being in the same event, there really shouldn’t be any difference in the results.
Like I said before it may be a bug or I’m just a dumbass …guess which one is it ? Dumbass ! I found that my Player’s idle animation was set to repeat itself no matter what …this caused a conflict between the two animations. Thanks Lizard I took up your advice and found that nasty code in the background…