AI a little question

hi I was reading this post
https://forums.gamesalad.com/discussion/45621/ai-for-enemies-in-a-platform-game
I done what MobileRocketGames writed but i want that when the enemy catch the player doesn't stop but continue to follow the player
can you help me? thanks (i'm not english sorry for any errors)

Comments

  • wayback_gamerwayback_gamer USMember, PRO Posts: 124

    I would try something like this.
    Create a boolean Game attribute "follow" and set to false.
    Create an integer Game attiribute "playerX
    Create an integer Game attribute "playerY"
    Now go to player actor and create a rule "When follow is true"
    constrain attribute player.position.X to Game.playerX-20
    constrain attribute player.position.Y to Game.playerY-20
    Then create a rule for the enemy actor. When actor collides with actor "player"
    change attribute Game.follow to true
    Finally create another rule for the enemy actor. When follow = true
    constrain attribute enemy.position.X to playerX
    constrain attribute enemy.position.Y to playerY
    This should help get you started. Experiment with behaviors! You can do it!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    I'm not familiar with the post you link too, but maybe this video will help?

Sign In or Register to comment.