Predation

This page includes the analysis, design, and implementation notes for my current predator-prey simulation.

Entity - Parent class of Predator and Prey.

Variables:

  • Position – Vector2.  Default: screen center.
  • Velocity – Vector2.  Default: (0, 0).
  • Max Velocity – Vector2.  Default: (10, 10).
  • Current Health -16-bit Integer.  Default: 10.
  • Max Health – 16-bit Integer.  Default: 10.
  • Texture – Texture2D.  Default: “entity.”

Predator - subclass of Entity; a predator entity that tries to survive by eating the nearest prey when hungry.

    Figure 1: Predator state machine.

    Predator FSA

Leave a comment