How do I Boolean attack with 8Direction

0 favourites
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • Thank you dop2000,

    Before I send him, do you also know how to let 8Direction enemys come to you in a certain range? and if they are too far away they will return ?

    thank you in advance

    (I've already spent hours searching for a solution, it's just not fun anymore)

  • I do not want to complain because construct2 is great,

    But It would be ideal if they would have some more specific tutorials with this kind of stuff.

    It is very difficult to search as a beginner in the deep

    youtube does have some content, yet it is very difficult to search for something specifc.

  • You can add a condition, something like this:

    System->Compare two values-> Distance(player.x, player.y, enemy.x, enemy.y)<500

    then move enemy towards the player.

    It's not specific to 8Direction behavior. You can compare distance or angle between two objects and execute different actions.

    Have you checked the Tutorials section and FAQ? I'm sure you can find many examples on how to do such things.

    https://www.scirra.com/tutorials

    how-do-i-frequently-asked-questions_t63692

    And here is someone else's game that uses similar mechanics - when player gets close to bees, they start moving towards him and attacking, but once they get too close, they stop. It's not a very good code, but it does what you want.

    https://www.dropbox.com/s/tvibytynqy997 ... .capx?dl=0

  • Thank you dop2000

    I'm going to look at it, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Here Is my test capx, I would appreciate it if you can improve it.

    Maybe you can also help with the enemy <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> , it's not necessary

    thank you in advance <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    Arrow keys for movement and space for attack

    https://www.dropbox.com/s/0jdeya9bsh8xx ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your "attack" animation didn't work because it was immediately replaced with "idle" or "walk" animation.

    You need to modify your conditions like this:

  • Hi dop2000

    Thank you very much for the effort, it works better now.

    Tomorrow I will focus on the Enemy movement hopefully It will succeed.

    Have a nice day

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