Esempio n. 1
0
 /// <summary>
 /// Constructor, that creates a new instance of PinkyChaseBehaviour
 /// and initializes its fields.
 /// </summary>
 /// <param name="targetMovementBehaviour">Movement behaviour for
 /// the target.</param>
 /// <param name="ghost">Instance of the ghost to be moved.</param>
 /// <param name="map">Map in which the gameobjects are placed.</param>
 /// <param name="targetMapTransform">
 /// <see cref="MapTransformComponent"/> for the target to
 /// be chased.</param>
 /// <param name="mapTransform"><see cref="MapTransformComponent"/>
 /// for the ghost.</param>
 /// <param name="translateModifier">Value to be a compensation of the
 /// map stretch when printed.</param>
 public PinkyChaseBehaviour(
     PacmanMovementBehaviour targetMovementBehaviour,
     GameObject ghost,
     MapComponent map,
     MapTransformComponent targetMapTransform,
     MapTransformComponent mapTransform,
     int translateModifier = 1)
     : base(
         ghost,
         map,
         mapTransform,
         translateModifier)
 {
     this.targetMovementBehaviour = targetMovementBehaviour;
     this.targetMapTransform      = targetMapTransform;
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor, that creates a new instance of InkyChaseBehaviour
 /// and initializes its fields.
 /// </summary>
 /// <param name="targetMovementBehaviour">Movement behaviour for
 /// the target.</param>
 /// <param name="map">Map in which the gameobjects are placed.</param>
 /// <param name="targetMapTransform">
 /// <see cref="MapTransformComponent"/> for the target to
 /// be chased.</param>
 /// <param name="blinkyMapTransform">
 /// <see cref="MapTransformComponent"/> for the ghost Blinky.</param>
 /// <param name="inky">Instance of the ghost to be moved.</param>
 /// <param name="mapTransform"><see cref="MapTransformComponent"/>
 /// for the ghost.</param>
 /// <param name="translateModifier">Value to be a compensation of the
 /// map stretch when printed.</param>
 public InkyChaseBehaviour(
     PacmanMovementBehaviour targetMovementBehaviour,
     MapComponent map,
     MapTransformComponent targetMapTransform,
     MapTransformComponent blinkyMapTransform,
     GameObject inky,
     MapTransformComponent mapTransform,
     int translateModifier = 1)
     : base(
         inky,
         map,
         mapTransform,
         translateModifier)
 {
     this.targetMapTransform      = targetMapTransform;
     this.targetMovementBehaviour = targetMovementBehaviour;
     this.blinkyMapTransform      = blinkyMapTransform;
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor for GhostBehaviourHandler.
 /// </summary>
 /// <param name="collision">Reference to collision.</param>
 /// <param name="pacman">Reference to pacman.</param>
 /// <param name="ghosts">Reference to ghosts.</param>
 /// <param name="map">Reference to map.</param>
 /// <param name="random">Reference to random.</param>
 /// <param name="pacmanMovementBehaviour">Reference to pacman
 /// movement behaviour.</param>
 public GhostBehaviourHandler(
     Collision collision,
     GameObject pacman,
     ICollection <GameObject> ghosts,
     MapComponent map,
     Random random,
     PacmanMovementBehaviour pacmanMovementBehaviour)
 {
     collisions  = collision;
     this.pacman = pacman;
     this.ghosts = ghosts;
     this.map    = map;
     this.random = random;
     this.pacmanMovementBehaviour = pacmanMovementBehaviour;
     chaseTime           = 15000;
     scatterTime         = 5000;
     frightenedModeTime  = 10000;
     movementChangeTimer = new Timer(5000)
     {
         Enabled = true,
     };
     ghostsMovementState = MovementState.Scatter;
 }