# Walking AI

**URL:** <https://forum.kirupa.com/t/walking-ai/186635>\
**Category:** programming\
**Created:** [April 23, 2006, 1:46am UTC](https://forum.kirupa.com/t/walking-ai/186635 "2006-04-23T01:46:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 23, 2006, 1:46am UTC](https://forum.kirupa.com/t/walking-ai/186635/1 "2006-04-23T01:46:02Z")

</div>

I’m part of this team made up from some of my friends and i’m working on a game where the cows’ need to randomly walk around the screen. What would I do? I could just tell the cows what coordinates they need to go to and then they would just loop. But that’s too much extra work and no doubt it would not come out looking very good at all.  
I have no idea where to start from, any resources and source code would be much appreciated.

---

<div class="post-metadata">

**Author:** ![fabiopb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/fabiopb/32/1886_2.png) [@fabiopb](https://forum.kirupa.com/u/fabiopb)\
**Post date:** [April 23, 2006, 2:26am UTC](https://forum.kirupa.com/t/walking-ai/186635/2 "2006-04-23T02:26:21Z")

</div>

you giving the cows a coordinate and looping it would simply make them move in the same manner over and over again… why dont you look at the tutorial on kirupa for random movement…  
[http://www.kirupa.com/developer/actionscript/random\_motion.htm](http://www.kirupa.com/developer/actionscript/random_motion.htm)

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 23, 2006, 4:49am UTC](https://forum.kirupa.com/t/walking-ai/186635/3 "2006-04-23T04:49:56Z")

</div>

Fabio, I realize that they would loop over and over again. The exact reason why I’m not doing it that way (I don’t mean to sound short)… And thx for the link.

---

<div class="post-metadata">

**Author:** ![cobrasniper555](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cobrasniper555](https://forum.kirupa.com/u/cobrasniper555)\
**Post date:** [April 23, 2006, 5:47am UTC](https://forum.kirupa.com/t/walking-ai/186635/4 "2006-04-23T05:47:36Z")

</div>

Have a function that picks a random point in a given area. And have that function placed in another function that tells the cow how to get there. Then have the one function that contains the other, run every couple of seconds. Here, for example:

```auto
onClipEvent(load){
var sec:Number = 1000;
function pickPoint() {};
function goToPoint(){
...
pickPoint();
}
setInterval(goToPoint,sec*7);

```

If you want me to, I’ll make you a .fla of it. I’ve used this engine before.
