Forum Topic: need A.I actionscript!

(226 views • 14 replies)

This topic is 1 page long.

<< < > >>
None

madnessassault

Reply To Post Reply & Quote

Posted at: 11/1/08 08:13 AM

madnessassault DARK LEVEL 09

Sign-Up: 02/16/08

Posts: 175

need help with programming the A.I for a platform game im making plz halp!


None

ThePeasant

Reply To Post Reply & Quote

Posted at: 11/1/08 08:34 AM

ThePeasant NEUTRAL LEVEL 08

Sign-Up: 08/30/07

Posts: 453

A.I. is the most difficult part of programming IMHO. I know for the game I've been working on it was the most lengthy and stressful part of the process.


None

mayoarm11

Reply To Post Reply & Quote

Posted at: 11/1/08 09:20 AM

mayoarm11 NEUTRAL LEVEL 17

Sign-Up: 06/13/07

Posts: 1,018

give us more info, dumbass

Awesome turret game in the making, featuring 85 uniqe turrets: News post

BBS Signature

None

RiotFlash

Reply To Post Reply & Quote

Posted at: 11/1/08 11:49 AM

RiotFlash NEUTRAL LEVEL 08

Sign-Up: 12/11/06

Posts: 1,325

At 11/1/08 08:13 AM, madnessassault wrote: need help with programming the A.I for a platform game im making plz halp!

the first step to making good AI (artificial intelligence) is to have good HI (human intelligence)

Check out my art, and scout me if you'd be so kind. :D


None

madnessassault

Reply To Post Reply & Quote

Posted at: 11/2/08 03:15 AM

madnessassault DARK LEVEL 09

Sign-Up: 02/16/08

Posts: 175

i just need a.i's to run accros a selected path and then hittest to goto a frame
'enemy = bug'
'hero = mouse'


None

anthony777w

Reply To Post Reply & Quote

Posted at: 11/2/08 03:19 AM

anthony777w LIGHT LEVEL 11

Sign-Up: 11/29/07

Posts: 129

At 11/2/08 03:15 AM, madnessassault wrote: i just need a.i's to run accros a selected path and then hittest to goto a frame
'enemy = bug'
'hero = mouse'

does it need to jump or just move
and is it on slopes or flat land

We all have our stupid moments...

BBS Signature

None

Pasty-Flawss

Reply To Post Reply & Quote

Posted at: 11/2/08 03:20 AM

Pasty-Flawss LIGHT LEVEL 13

Sign-Up: 01/22/08

Posts: 432

At 11/2/08 03:15 AM, madnessassault wrote: i just need a.i's to run accros a selected path and then hittest to goto a frame
'enemy = bug'
'hero = mouse'

You could do that with a motiontween.


None

anthony777w

Reply To Post Reply & Quote

Posted at: 11/2/08 03:22 AM

anthony777w LIGHT LEVEL 11

Sign-Up: 11/29/07

Posts: 129

At 11/2/08 03:20 AM, Pasty-Flawss wrote:
At 11/2/08 03:15 AM, madnessassault wrote: i just need a.i's to run accros a selected path and then hittest to goto a frame
'enemy = bug'
'hero = mouse'
You could do that with a motiontween.

Not if you want it to follow the character

We all have our stupid moments...

BBS Signature

None

madnessassault

Reply To Post Reply & Quote

Posted at: 11/2/08 04:09 AM

madnessassault DARK LEVEL 09

Sign-Up: 02/16/08

Posts: 175

possibly curved but mostly flat.. and the a.i will follow th mouse


None

Pasty-Flawss

Reply To Post Reply & Quote

Posted at: 11/2/08 04:13 AM

Pasty-Flawss LIGHT LEVEL 13

Sign-Up: 01/22/08

Posts: 432

At 11/2/08 03:22 AM, anthony777w wrote:
At 11/2/08 03:20 AM, Pasty-Flawss wrote:
At 11/2/08 03:15 AM, madnessassault wrote: i just need a.i's to run accros a selected path and then hittest to goto a frame
'enemy = bug'
'hero = mouse'
You could do that with a motiontween.
Not if you want it to follow the character

He said run across a selected path.


None

Xeltio

Reply To Post Reply & Quote

Posted at: 11/2/08 06:39 AM

Xeltio NEUTRAL LEVEL 02

Sign-Up: 11/01/08

Posts: 8

You can make it try and attack your mouse with trig.

This will make the enemy rotate to the position of the mouse.
enemy.rotation=Math.atan2(enemy.x-mouseX ,mouseY,enemy.y);

Simple Trig to make the bug move to the mouse.
enemy.x+=Math.cos(enemy.rotation*Math.PI /180)*5;
enemy.y+=Math.sin(enemy.rotation*Math.PI /180)*5*-1;

Hope it helps you out a bit.


None

Xeltio

Reply To Post Reply & Quote

Posted at: 11/2/08 06:40 AM

Xeltio NEUTRAL LEVEL 02

Sign-Up: 11/01/08

Posts: 8

Also. If you want a enemy to run over a selected path its best to use an array to hold the points that movie clip needs to go to.


None

Zerobeam

Reply To Post Reply & Quote

Posted at: 11/2/08 06:44 AM

Zerobeam NEUTRAL LEVEL 07

Sign-Up: 11/03/05

Posts: 682

Just to get a common mistake out of the way:

A.I. stands for Artificial Intelligence. That means the computer is able to make its own decisions when needed.

Walking a NPC through a selected patch is just scripting.


Elated

Fierce-deity490

Reply To Post Reply & Quote

Posted at: 11/2/08 10:29 AM

Fierce-deity490 EVIL LEVEL 03

Sign-Up: 01/17/06

Posts: 22

for the game im workin on atm, its a sidescroller, and the AI follow script is simple. Cant remember the exact syntax but its like
if hero._x => enemy._x
enemy._x += 5

So if the x axis of the enemy is less than the heroes, it adds to that axis. And vice versa..
does that help?


None

madnessassault

Reply To Post Reply & Quote

Posted at: 11/2/08 04:33 PM

madnessassault DARK LEVEL 09

Sign-Up: 02/16/08

Posts: 175

yer ill try the trig stuff thanks xeltio, why doesnt someone just join in on the collab and help me with al the actionscript cause all i can do is buttons


All times are Eastern Standard Time (GMT -5) | Current Time: 07:00 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!