
Plan your behavior
So I have introduced how to plan out simple AI behavior from my previous post – Cheating AI from Hardcourt – Plan it out – if you haven’t, read that one first before this.
Our next step would be writing the data charts into codes. It might look quite easy when you see the simple flow charts but remember that the AI must process this through out the game with a character’s lifespan.
What I’m about to share is simply a psuedo codish (partly actionscript syntax) of the AI’s logic. Eventually you can port it into which ever approach you are comfortable with, like OOP or the old school timeline.
Remember that this is my first published game where as I still used AS2 using prototypes and functions but I’ll discuss this in a little of close objective approach. First of we prepare a few world declarations & preparation in a quick manner.










•