Incoming damage markers?

0 favourites
  • 5 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 there. I've been using Construct casually for a while now, but it wasn't until recently that I've been seriously trying to make a game.

    My game is basically a mobile version of a light gun arcade shooter, like House of the Dead or Time Crisis. As of right now, I have the basic systems in where you tap the screen to damage enemies that spawn. Each enemy has their own life counter, and dies after a certain number of hits.

    Now here comes the part where I'm stuck: adding enemy attacks. I am currently focusing on making melee attacks, but this poses a problem.

    The way I want it to work is as such: when an enemy makes an attack, it puts a visual marker with a countdown or other timer imagery on the screen. The player must tap there with good timing to avoid being hurt, and possibly even stuns the enemy for a moment.

    I would provide an example picture, but apparently I am not allowed to post links yet?

    I am spawning an invisible hitbox centered on a red countdown number, which is placed over the attacking enemy. I am facing a few issues, the main which is that these attack boxes or hit boxes aren't tied directly to any specific enemy. If the enemy that is supposed to be melee attacking dies, the attack continues. Secondly, I do want to add stunning the enemy that is blocked, but as I said before, I don't know of a way to tie these attacks to specific enemies.

    I know how to do instance variables, but I don't know how that would help in this instance.

    Are there any ideas that might help me here?

  • It seems to me, this is a perfect example for when to use containers..

    Another way would be to bind the timer to the enemy by UID..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see, I didn't know about containers. or UID. It seems like containers will be very useful going forward for putting together enemy types.

    But reading the documentation on containers makes me think that this might still be an issue... won't deflecting or destroying the attack also destroy the enemy?

    Unless, of course, I just have set attack points on each enemy where they can have an attack go off, and just toggle visibility when an attack starts, ends, or is avoided.

    I'll mess around with this and post results. Thanks for the tip.

  • Containers worked perfectly, thank you!

    As a note for some side effects, I had to make a few minor changes to the game so that stopping an incoming attack didn't also damage the monster attacking.

    Thank you so much for your help!

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