Submissions from 2017-10-25 to 2017-10-26 (1 total)

After creating the more reuseable Ability system last night, I was on a refactoring roll. Today, I pulled all the movement-specific logic out of the Player and into a new TileMovement component. This will be necessary to add movement logic to NPCs later, but it also makes the interface point for the abilities more clear. Instead of passing a Player component in to them, I just pass a TileMovement reference. Now they can move players, boxes, or enemies just the same!

With that done, I was tempted to create an AI enemy that moved, but I don't want to tackle that just yet. Instead, I proved-out the concept by giving the Player an ability that can move an arbitrary other object given it has a TileMovement component.

Enter the "Push" ability. From a game design perspective, this will be used tactically for ranged entities to keep melee monsters off themselves.

This just entailed implementing a new AbilityBase derivative, and implementing the API. I also proved-out the statement I made last night that specific abilities can provide extra configuration so more interesting instances of them can be created.

I used 1 PushAbility class to create 2 new abilities:

  • Directed-Push: pushes 1 enemy 3 units in the opposite direction of the player
  • Circle-Push: pushes all entities around the player 1 unit away.
    • For now, this still requires the player to tap the screen, but it will automatically affect any targets in the mask (as opposed to only attacking a specific enemy). Eventually, when is a better UI with separate buttons for each attack, clicking the ability will instantly trigger the action, since there is no 'targetting' required.
Heres a GIF of both in action: