Page 1 of 1

Trouble with punching

PostPosted: Mon Apr 30, 2012 4:35 pm
by Goomba
How would I make it so whenever the character punches that it can hurt the enemy? Then when it's still that the character can be hurt? :? :?

Re: How would I...

PostPosted: Mon Apr 30, 2012 4:43 pm
by skydereign
Please use more descriptive topic titles. I've let it go for a while, but people seem to continue to do it. It is a lot easier for users searching for answers if the posts have relevant titles. So while it doesn't benefit you directly, it does anyone who is trying to find an answer (since searching the forums is a good idea before asking a question). This prevents too many duplicate questions.

Goomba wrote:How would I make it so whenever the character punches that it can hurt the enemy? Then when it's still that the character can be hurt? :? :?

Normally you would use some form of variable to determine if the actor is punching or not. Then in the collision code between the two actors, you check if the actor is punching or not. If it is, then put your "hurt the enemy" code, else, put the code for when the player is hit.

Re: Trouble with punching

PostPosted: Mon Apr 30, 2012 5:38 pm
by Goomba
uh sorry for the title. :oops: so I would put a keydown event (punch button) then i put in a variable to detect the animation or something like that? or would that make me get a headache? :? (by the way, i change the title :) )