Melee attack by holding a key

  • hi, again here ..

    Some comrade would know how to improve a melee attack by holding a key with the following characteristics

    drive.google.com/open

    I have not been able to solve some basic errors

    as the death of the enemy that is almost not seen and the continuity of movement after the attack..

    I can not see the error

    if there is any way to improve a melee attack like this I accept any kind of idea.. thank you already

  • There you go :

    You should check Enemy overlap ray_attack instead reversed it.

    The overlap and not overlap should be same level of condition.

    The condition enemy_life should cover the overlap checking, because when it not overlap it will back to "enemy_normal" although the life bar has been destroyed.

  • thanks for the guide, it worked

    but he still has an error, and that is that after being attacked he takes a different direction to his path ramdom...

    any ideas?

  • I think you need to save his current angle of motion in a variable.

    Then when not overlap, set it angle of motion to that variable.

  • sorry mate, but I do not know how to apply it to a variable, nor the type of variable to use.

    Would it be of a numeric type, text?

    would you give me an illustrated guide please .. I would appreciate it very much

  • I am not computer right now so I can't take the screenshot.

    Here is what I did:

    - Have an instance variable on enemy(ex: movingAngle)

    - Save bullet.angleOfMotion on start layout

    - Save when collide with WALL

    - Set angleOfMotion = self.movingAngle when not overlap electricShock

  • humn ok mate,.. thanks

    I'll try

  • Here is the screenshot :

    It is short because I search it in the eventsheet.

    These are the place it appear

  • I fix that, but it produced a new error ... this is costing me more than I thought.

    they all take the same direction ..

    I have added new things to make it more interactive, but it has not gone very well

    I wanted a life bar that decreases progressively while being attacked, but with a damage sound that is repeated every so often accompanied by a number that shows the level of damage that is being received.

    but it repeats and it repeats without stopping, I have put a trigger once but the bar fails and neither the sound nor the point returns to reproduce while the attack lasts.

    I will understand if you no longer want to help me, this is the modified file, in case you want to take a look at it, to understand the idea

    drive.google.com/open

    If you decide to answer one more time, it is better that you send me the modified capx, just do not feel committed to help me more.

    thank you so far

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Haha, there you go : drive.google.com/open

    At first,I made an example with the Global Variable for one enemy.

    So if I need to apply for many enemies, the Global Variable is not my choice.

    Because it have 1 value and you want to apply for all instances, it is not logical at all.

    I am using Instance Variable for each enemy.

    Do the same with one enemy and it is working well.

    In the future, please don't stick with one direction, try to improvise for other situations :)

  • thank you very much mate really

    and you're right,..... I'm very novice yet

    I hope to learn more, for not to bother so much here :(

    thanks again

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