How do I assign different damage for different animations?

Get help using Construct 2

Post » Fri Jan 09, 2015 6:55 am

Hi, I want to build a game like Defender's Quest. I want to make towers with a few different attacks and different damage. For ranged towers, I supposed I can set the damage on its projectile collision. But how do I set different damage for MELEE towers? I can set different animations for it, but how do I determine which animations deal which damage?

Further more, I want to ask how to do critical attacks?
B
7
Posts: 20
Reputation: 293

Post » Fri Jan 09, 2015 7:10 am

I couldn't quite understand your question. You have a single tower that does 2 types of damage - ranged and melee, correct? Or you have two different towers 1 is ranged and 1 melee?

This is pretty straight forward:
Object -> Is Playing -> Animation Name -> Set this damage

For the damage you can use the random expression. Say you want to do between 50 and 100 damage per hit you can assign it to random(50,100) or if you want only round numbers floor(random(50,100)). Using this for randomly assigning a critical hit could work as well - randomly hit for a random damage between 150 and 200.
Ba-dum Tsss!
B
11
S
2
G
1
Posts: 45
Reputation: 757

Post » Fri Jan 09, 2015 11:42 am

^ I meant like Defender's Quest. A tower with 5 skills, each skill can be either range or melee and deal different damage.

And I have some more questions. I want to upgrade towers. How do you add new abilities like critical strike or slow to a tower after upgrading? Can I add attribute to it or do I have to change it to a new object?
B
7
Posts: 20
Reputation: 293

Post » Fri Jan 09, 2015 1:17 pm

@hsm4ever

As @NicotineLL mentioned, you may just check the animation playing and set the base damage accordingly. For the critical, you can have a damageMultiplier on your damage calculations, which is set to 1 all the time, but set to 2 (or 3 or whatever you want) when you get a critical.

Here's a very simple example, just so you get the gist of it:

multiple-weapon-tower-example.capx


Click the buttons to change the animation. The chance of a critical is very high (10%) just to allow you to see it happen.
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 428
Reputation: 2,337


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MPPlantOfficial, Sup with that?, Yahoo [Bot] and 60 guests