Trouble with punching

Non-platform specific questions.

Trouble with punching

Postby Goomba » Mon Apr 30, 2012 4:35 pm

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? :? :?
Last edited by Goomba on Mon Apr 30, 2012 5:38 pm, edited 1 time in total.
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score

Re: How would I...

Postby skydereign » Mon Apr 30, 2012 4:43 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Trouble with punching

Postby Goomba » Mon Apr 30, 2012 5:38 pm

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 :) )
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron