Windows What Coding do I use to make my AI chase my pacman?

D

Distant_Virus22

Guest
Hi everyone,
I am new to making games on my own and I need help with getting my feet wet in programming. I was just wondering what kind of coding should I use to make my AI chase my pacman player. My room size is 1001x1486(just to keep my instances there) and my snap is 40x40. My sprites/ objects are also 40x40

If someone could get in touch with me soon that would be awesome!



Thank you guys so much also glad to be part of this community!
 

Xer0botXer0

Senpai
I'm not sure about the behavior of the ai, as far as I know they have these states, roam, chase, evade, hide.

They'll spawn then immediately go to roam then look when the target is within range of their position and when so will go to chase.. if target has changed from eating an orb they will move to evade and try to avoid getting eaten, when they are eaten they will move to hide which is returning to spawn. They may also return to roam or chase if the orb wears off.

You'd use a few if statements perhaps even a switch statement if it works better. You can have them roam randomly or even use path finding with preset go to positions with the choose() function to give them a variety of paths.
 
Top