This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-07-22 17:24:03

super_yoshi
Scratcher
Registered: 2008-06-09
Posts: 4

help me make AI

i need some AI for that game where u control something that leaves a trail behind it, and if you or the other player hits it, they die. so basically i need an AI that will try to avoid hitting certain colors while trying to make the player hit the pen thats following it. i understand this might be difficult or, dare i say it, impossible. thanks in advance

Offline

 

#2 2008-07-22 17:28:20

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: help me make AI

Oh, like Tron? I tried. Very hard to do this. Most likely using a sensor to detect the line.


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-07-22 18:15:08

super_yoshi
Scratcher
Registered: 2008-06-09
Posts: 4

Re: help me make AI

im realy annoyed that i cant for the life of me remember what the games called. im a total fail at making AI if somone could tell me exactly which blocks to use i would love them

Offline

 

#4 2008-07-22 21:26:37

ashbyr1
Scratcher
Registered: 2007-12-04
Posts: 100+

Re: help me make AI

Don't worry.  It's not impossible.  In fact, it's not even really that hard.
For starters, you'll need to attach a sensor sprite to the AI sprite.  (Search the projects and forums for sensor tutorials.)

Then you just set up your if then logic so that if the distance to the player is less than the distance to the color, got toward the  player, but if the distance to the player is greater than the distance to the line, try to circle to the far side of the player.  This would get you the basics.  Obviously you could start to program more complex strategy if you want.


Learn the basics with these video tutorials.
Or nominate an All Star Animation.

Offline

 

Board footer