User Tag List

Results 1 to 2 of 2

Thread: Help with platformer zombie AI

  1. #1
    No Products Registered

    Join Date
    Sep 2017
    Location
    UK
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Help with platformer zombie AI

    Hello all

    I am currently developing a zombie survival game where you survive waves and buy weapons and repair barriers with money earned.
    With that said, all I want to know is how to make zombie AI which will track the player down and kill them. I tried to follow a tutorial on YouTube
    but the person who made the video spoke too fast and didn't really explain what to do. If any one could help me to figure out this problem
    I would be very thankful.

  2. #2
    Clicker iOS Export ModuleInstall Creator Pro
    Dex's Avatar
    Join Date
    Jun 2015
    Location
    West Yorkshire, England
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mmmm...... One way to do it is to simply check the x/y co-ords of the zombie against the players x/y co-ords.

    If its 8 way movement then something like this will work (Pseudo-Code following):

    IF PLAYERS X IS LESS THAN ZOMBIES X AND PLAYERS Y IS GREATER THAN ZOMBIES Y THEN THE PLAYER IS LOWER DOWN THE SCREEN THAN THE ZOMBIE AND IS TO THE LEFT SIDE OF IT SO ZOMBIES X=X-1 AND ZOMBIES Y=Y+1

    Or........

    If Player(x)<Zombie(x) + Player(y)>Zombie(y)
    Zombie(x)=Zombie(x)-1
    Zombie(y)=Zombie(y)+1

    You get the picture??

    If you do that with all 8 possible x/y positions then the zombie will always chase the player.

    If I were you I would put the zombies in to a "group" as that would be much better.

    Also you may want to set a limit on how far away the player has to be before the zombie "sees" him.? If you do then you can use the same way as tracking the player by telling the zombie that if the distance between the player and zombie is greater than 100 (or whatever) then ignore the tracking of him.
    Again just use the x/y of the player and zombie to set that up.

    Hope that helps.

Similar Threads

  1. How do I make a zombie?
    By timothyqq in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th August 2014, 11:43 AM
  2. Zombie AI?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 25th November 2012, 06:51 PM
  3. Zombie Swarm
    By Sumo in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 30th October 2011, 11:54 AM
  4. Zombie AI
    By jhonson in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th October 2008, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •