Jump to content

  • Log In with Google      Sign In   
  • Create Account


Trihex

Member Since 17 Apr 2009
Offline Last Active Oct 18 2013 09:34 AM
-----

Topics I've Started

Looking for a good pattern

08 December 2012 - 03:45 PM

For the game I'm working on, the player has the ability to throw certain items onto the battle board that can effect the AI. By way of example, one of the items is a decoy. If the player throws a decoy on the board, then for the number of actions the item is active (10 for a default decoy), the AI will move toward the decoy instead of the player.

Some AI will be effected by some items, and not by others. I'm looking for a nice clean way of handling getting the information of what Items are currently on the board to each AI to allow them handle the specific items that effect them. I'm thinking some sort of consumer pattern, where each enemy type can "subscribe" to the item types that effect them and get notified when ever any of those are on the board.

If anyone could point me to information on any kind of pattern that would handle this situation, that would be most appreciated. I'm writing the game in Java, but examples in any language are fine.

Thanks,
Eric
http://www.bloodytongue.com
1000 Dungeons

PARTNERS