Enemies damage?

0 favourites
  • 3 posts
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.
  • Hi! my enemies are hurting me when im in contact with them. The problem is that i dont have a change to hit them with for example punches before they hit me. I want to be able to hit them and dont get hurt myself (my character) But get hit if i just touch them. How can i think around this issue?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • When your character performs a attack action spawn an "punch" sprite in front of your character, then in your events have an event for the collision of that sprite with the enemy for damaging the enemy. Destroy the "punch" sprite destroy after collision with an enemy or after a very short time ( the fade behaviour is good for this - fade in: 0, wait: 0, fade out: 0.1, destroy: true ). You can either have the sprite be transparent or set the initial visibility to false so that it doesn't appear.

    There's a few other cool things you can do with this as well, it's kinda handy.

  • You could set state for your player that is punching or not.

    If he is not punching and collide with enemy, he will get hurt.

    If he is punching and collide with enemy, the enemy will get hurt.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)