Friday, March 15, 2013

Inhibitor Component

During my ability creation, several of my ninja abilities affected the enemies' movement.  Thus, I thought it prudent to make a component that controls the owning character's movement speed.

After some discussion, we decided to expand this into a more broad component that affects all aspects of a character's control (movement speed, stunned, frozen, etc).  Thus, we called it the Inhibitor class.

Simply put, this class created flags for each type of inhibitor effect (like movement speed).  When this flag is triggered, the update function will handle the execution of the inhibitor effect for as long as the flag is triggered.  However, each inhibitor effect has a timer that is set when the flag is triggered (which ticks down every time the update function is called).  Once that timer finished, it sets the flag to false.

It's very simple to maintain and call, so I'm quite happy with it.

No comments:

Post a Comment