Exemplo n.º 1
0
        /// <summary>
        /// Move the player towards the given direction.
        /// </summary>
        /// <param name="dir">Direction to move.</param>
        /// <returns>true if moved; false if the path is blocked.</returns>
        public bool MovePlayer(Directions dir)
        {
            var player = BaseAction.FindCharacter(currScenario, MapElements.HERO);

            var moveArg = new MoveArg(player, dir);
            var move    = new MoveAction();

            return(move.Execute(currScenario, moveArg));
        }
Exemplo n.º 2
0
 public void MoveTarget(CharacterEntity character, Vector3 endPos, float moveTime)
 {
     if (character)
     {
         MoveAction moveAction = new MoveAction();
         moveAction.character     = character;
         moveAction.endPos        = endPos;
         moveAction.moveTime      = moveTime;
         moveAction.stateNameHash = Common.Animators.AnimatorUtil.RUN_ID;
         moveAction.Execute();
     }
 }
Exemplo n.º 3
0
 public void MoveBackward()
 {
     _engine.CurrentOrientation = DirectionCalculator.South;
     _moveAction.Execute(_engine, new[] { "move", "backward" });
     Assert.Equal(_secondLocation, _engine.CurrentLocation);
 }