Test creature AI implemented by behaviors:
TCastleMoveAttack- move towards the player and attack when close enough.TCastleLiving- manage life (hit points), for both enemies and player.
See behaviors about using behaviors and implementing your own.
Note: This example runs much faster in the Release mode (when optimizations are enabled). In Debug mode, the FPS is noticeably much slower. This is true of all CGE applications, but it's especially noticeable here. See how to optimize your applications.
Using Castle Game Engine.
Compile by:
-
CGE editor. Just use menu items "Compile" or "Compile And Run".
-
Or use CGE command-line build tool. Run
castle-engine compilein this directory. -
Or use Lazarus. Open in Lazarus
creature_behaviors_standalone.lpifile and compile / run from Lazarus. Make sure to first register CGE Lazarus packages. -
Or use Delphi. Open in Delphi
creature_behaviors_standalone.dprojfile and compile / run from Delphi. See CGE and Delphi documentation for details.
