Patrol and Attack

0 favourites
  • 3 posts
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • With the help of users on this forum, I've reached a pretty good point in the development. I can have many NPCs walking around and navigating the level pretty well.

    The problem comes when I want the NPCs to change what they are doing. Their standard action is to randomly walk around the level, however, I also have a system in place that has them shoot objects out in front of them, which get larger until they hit a wall, at which point they are destroyed. This is to replicate their field of vision, so certain parts are obstructed by walls, but NPCs will still be able to see the player from the 'corner of their eye' so to speak.

    When these field of vision objects hit the player, it spawns a remember point at the players location, which the NPC should walk toward, and hopefully be updated when the field of vision again hits the player. This will allow the played to hide from and escape the NPCs.

    In any case, I hope I explained that well. The problem is that I struggled to have the field of vision objects relate to the correct NPC, but I think I have that sussed. The issue comes when I want the NPC to follow the player. For some reason, once they have found the player, they just walk straight into a wall and get stuck. I cannot see what I have done wrong.

    I'd also like to know if there is a way to simplify what I have done.


  • Are you using pathfinding to reach the player or just saying move in direction of the player?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To reach the player <img src="smileys/smiley1.gif" border="0" align="middle" />

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