The Daily Click ::. Forums ::. Klik Coding Help ::. Timing, timer, anything related to that, timing issues, holding down buttons, repeating, etcetera.
 

Post Reply  Post Oekaki 
 

Posted By Message

SawMill



Registered
  29/08/2004
Points
  15
29th January, 2006 at 12:05:58 -

Hello.

I'm working on a game, and the main character has a punching and kicking animation. Since they're relatively similar, i'll refer only to the punching animation from this point on.

When the player presses the button to punch, the animation plays out, everything is fine, except the only problem is, holding down the button results in the animation playing and the sound playing over and over again. Continously. I wouldn't want the player to just hold down the button and walk through the level would I? So would anyone have a good idea on which events I would need to place to sort of introduce a timer, so after the first punch, a timer starts, when timers reaches 0, the second punch can take place?

Thanks much.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
29th January, 2006 at 12:46:44 -

First try making sure the "Player presses X" comes first in the order of triggers for your punching event. That will stop it repeating, hopefully.

For more security, within the event, set a counter to some arbitrary number.
Add 'counter = 0' to the triggers for the event.
Add a 'counter > 0: subtract 1 from counter' event.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click