Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6804137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:25:45+00:00 2026-05-26T19:25:45+00:00

I need a simple AI script to make a zombie object ‘walk’ around randomly.

  • 0

I need a simple AI script to make a zombie object ‘walk’ around randomly. I’ve googled and googled but all I can find is stuff on the mathematics function ‘Random Walk’. Maybe it’s related?

I’m using my own JavaScript 2D engine and I need to have something like:

function update() {
    //Move using available physics engine stuff:
    // this.position, this.rotation, this.velocity, this.torque, this.acceleration
    // this.torqueAcceleration, this.drag, this.torqueDrag
}

Thanks! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:25:46+00:00Added an answer on May 26, 2026 at 7:25 pm

    I did do a similar script in C# XNA 2 years ago.

    The logic is simple. Let’s talk about the logic of walking one zombie in pseudo-code:

    The following is the walkable space / platform for the zombie:

    x = 0 ___________________________ x = 100
    
    1. Pick a random position to spawn the zombie.
    2. If the position is more than half the walkable space, zombie face left. Otherwise zombie face right.

      x = 0 _____________________<_____ x = 100
      x = 0 _______>___________________ x = 100        
      
    3. Pick a random distance to move between 5 to the end of the walkable space.

    4. Start the walking the zombie for the distance picked.
    5. Wait for a amount of time between 2 seconds to 15 seconds (15 seconds because some zombies just like to daze around).
    6. Go to Step 2

    This should help you to create your script for all the zombies to roam around the map aimlessly. You can vary the values I’ve written in the pseudo-code to suit your game.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a simple proxy PHP function/script that can download a file from a
Any simple, but secure script available for Flash > MySQL DB integration? I need
Hi, I have made this simple script but I need to have it check
I'm building a fairly simple PHP script that will need to send some emails
I am trying to make a simple markup language, and I need my Cocoa
I had to make a really small and simple script that would fill a
I use this custom, simple script I made, somehow it's failing but it always
I've made a simple bash script that need to keep it's super-user privileges throughout
A simple question i can't figure out. I'm having this simple sendmail script in
I need to make a simple search across select box with single selection. Main

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.