Destroy with melee

  • 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: dropbox.com/s/ryom0vrmfg6ry9f/Jungle%20Tutorial%20%28Hulk%29.capx

    Thanks in advance

  • 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.

  • Thanks Vercingetorix,

    "Commenting my events"..what do you mean by that? Like highlighting them somehow?

  • 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

    scirra.com/manual/81/comments

  • Thanks,

    Will do from now on.

  • 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:

    dropbox.com/s/ryom0vrmfg6ry9f/Jungle%20Tutorial%20%28Hulk%29.capx

    I labeled it and it is at the very bottom.

  • 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

    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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

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