Hey, I'm Tony Yotes, but just Yotes works just fine. I was born in the '90s, which in my humble opinion, was the perfect age to grow up playing awesome games across all generations. That childhood inspired me to pay those good times forward and create my own video game empire. Check out everything I do at www.yotesgames.com

Report RSS Organizing Enemy Code For My Games

Posted by on


I should keep a comment list of all methods before the first one starts.
I can find them easier that way.

One of the things I need to keep in mind for future projects is the way I write AI code. I need to organize things into very specific methods to minimize copy/paste lines of logic and everything needs to be placed in a way that makes looking for a particular method easy. I think I did pretty well with Unicorn Training, especially compared to how I started with TriGrid.

All the enemies have similar behavior methods organized in the same way. The AimAtPlayer()method is always after the NearPlayer() method and before the Knockback() method. Over time I'm getting better at writing clean code because I'm learning what my needs as a designer are. It'll be interesting to see how my way of thinking changes when I switch to turn-based AI code next year.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: