Incoming damage markers?

Get help using Construct 2

Post » Tue Sep 09, 2014 9:49 pm

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?
B
4
Posts: 8
Reputation: 216

Post » Tue Sep 09, 2014 10:06 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 09, 2014 11:04 pm

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.
B
4
Posts: 8
Reputation: 216

Post » Wed Sep 10, 2014 12:02 pm

B
23
S
5
G
4
Posts: 142
Reputation: 3,262

Post » Thu Sep 11, 2014 1:32 am

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!
B
4
Posts: 8
Reputation: 216


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 12 guests