Enemy A.I. Code???

Blitz3D Forums/Blitz3D Programming/Enemy A.I. Code???

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

That's basic state AI

You code would look something like:
If entitydistance(badguy,player)<chasedistance and badguystate = roam
	If the badguy can see the player (linepick)
		badguy go into chase mode, chasing player
	endif
endif

if entitydistance(badguy,player)<attackdistance and badguystate=chase
	attack player
endif

if entitydistance(badguy,player)>chasedistance then badguystate=roam

if badguystate=roam then bumble around
if badguystate=attack then smack,smash,destroy
if badguystate=chase
	where's the good guy.
	Point at him
	Move towards him
endif