Tag Archives: Subclass

Pluggable AI Using Polymorphism

I was talking briefly on Twitter the other day about how I was using polymorphism in C++ to handle different types of AI in Drifter and someone suggested I should make a blog post about it. As I’ve been wanting to post something new for a while, I figured why not!

I apologize in advance if this is not the Right Way to do this, but it works, and that’s the main thing. Also I reference C++ but any object-oriented language that supports sub-classing should be able to implement something similar.
Continue reading