Ok. Here's the script:
Make a costume for your charcter when it's standing and a costume for it when it's puching.
Your hero script:
[blocks]<when green flag clicked>
<forever>
<if><key[ space ]pressed?>
<switch to costume[ punching costume ]
<wait( 1 ) sec>
<switch to costume[ normal costume ]
<if><touching[ enemy sprite ]
<broadcast[ hit ]
<end>
[/blocks]
Make your enemy a costume of normal and being punched
Your enemy script:
Script 1:
[blocks]
<when green flag clicked>
<show>
<switch to costume[ normal enemy costume ]
[/blocks]
Script 2:
[blocks]
<when I receive[ hit ]
<switch to costume[ being punched ]
<wait( 1 )secsc>
<hide>
[/blocks]
Offline