|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
BeelineAI | Makes hostile monsters attack the nearest player, without checking for walls or obstructions. |
ShipAI | Implements the AI for sailing ships (e.g. pirate ships); needs work. |
Provides the standard built-in game AIs.
It's perfectly acceptable for you to create your own AI if the standard ones don't suit your needs. To create your own AI, just subclass AbstractAI and provide your own think() method for the monster.
Sometimes you'll want to create an AI that switches between existing AIs - for example, let's say you want to be able to switch a monster from wandering randomly to being aggressive (perhaps when the monster has had something insulting said to it). To do this, start by placing the monster under the RandomAI like so:
RandomAI.add(monster);Later, when the monster is ready to become aggressive, switch it to the StandardAI as follows:
RandomAI.remove(monster); StandardAI.add(monster);Switching AIs on the fly like this can lead to much more interesting and personalized monster behaviors.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |