Login | Register

Basic shooting AI

August 28, 2007, 13:06 by death-droid
[loading]
-->
This is what i use to start off my AI as it is simple and you just slowly expand on it.

Lots of AI for game maker use the distance_to_object as it is very useful with it.

Heres a example of code i have done.

You can use it if you give credit.


if distance_to_object(object0)<300 then if instance_number(bullet)=0 {
instance_create(x,y,bullet)
}


First it checks the distance then checks then checks if theres no bullets exist then if thats all fine it creates a object which i have made go in the direction the ai was pointing.

Hope fully this helps some people with some AI programing.

Ill post more in normal category.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games