Destroy with melee

Get help using Construct 2

Post » Sat Dec 01, 2012 8:43 am

I hate to ask, but I cannot figure this out.

I've already got my character to melee, but I have tried a few things to get him to actually kill the enemies and nothing works. The closest I got is to where he melee's anywhere on the map and kills all enemy I set to destroy. I just want him to kill whatever he actually touches when he melees.

Can anyone help me with this or send me a link to a tutorial/topic/or a capx that has a clear way of explaining it?

Here is the capx: https://www.dropbox.com/s/ryom0vrmfg6ry9f/Jungle%20Tutorial%20%28Hulk%29.capx

Thanks in advanceMAVERICK2012-12-01 08:46:14
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sat Dec 01, 2012 10:27 am

Here is one way you can do it

Give your enemies a instance variable called "Hits" then create the following events

Enemy is overlapping player
Player Attack animation is playing
Trigger once
> add one to Instance variable "Hits"

"Hits" is greater or equal to 1
> Destroy enemy


Also you should probably get into the habit of commenting your events especially if you plan on asking someone for help.Vercingetorix2012-12-01 10:42:10
B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Sat Dec 01, 2012 8:19 pm

Thanks Vercingetorix,

"Commenting my events"..what do you mean by that? Like highlighting them somehow?
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Dec 02, 2012 12:09 am

If you right click on a blank space in the event sheet you have the option of adding a comment. You can use these to label your events so that you and other people are able to quickly and easily identify what they do.
For more info see
https://www.scirra.com/manual/81/comments


B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Sun Dec 02, 2012 5:36 am

Thanks,

Will do from now on.
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Dec 02, 2012 6:39 am

Hey Vercingetorix,

Thanks a lot for your help and the information you've provided me. I'm still new to learning how everything works. I'm sorry to keep asking you about this, but I just need your help to finish with what the info you've provided me.

I'm not sure exactly how to set it up. Am I using conditions or sub-events? Plus the last one I cannot figure out how to incorporate at all. You say "> destroy enemy", but what would select before that. I've tried a few things, but nothing worked. I would add a screenshot, but I cannot figure out how to so here is the capx. again:
https://www.dropbox.com/s/ryom0vrmfg6ry9f/Jungle%20Tutorial%20%28Hulk%29.capx

I labeled it and it is at the very bottom.
B
23
S
6
G
3
Posts: 122
Reputation: 2,922

Post » Sun Dec 02, 2012 8:22 am

Sorry, I think in trying to write the events out as text I may have made them a bit confusing to follow. Here is your file with the solution I described applied to the enmey Snail2

http://dl.dropbox.com/u/56373295/Construct%202%20Files/Destroy%20with%20melee.capx

I also just realised that if enemies only take one hit to be defeated they don't even need a hit variable so the file has the solution for enemies that only take one hit and slightly modified version for enemies that take more than one.
B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Sun Dec 02, 2012 11:33 am

Thanks a lot Vercingetorix. I appreciate your help very much. I'll take a look at it within the next 10 hours. For now I gotta get some sleep. Thanks again for all your help.MAVERICK2012-12-02 20:49:06
B
23
S
6
G
3
Posts: 122
Reputation: 2,922


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests