Beispiel #1
0
 void PlayerEnteredTile(TileMovingObjectScript TileObject, StinkyFile.SRotation Direction)
 {
     if (TileObject.SpecialObjectIgnore)
     {
         return;
     }
     if (!TryMove(TileObject, Direction))                                                // try moving forward
     {
         if (!TryMove(TileObject, TileMovingObjectScript.GetBehindDirection(Direction))) // try flipping around
         {
             Player.KillAllPlayers();
         }
     }
 }
Beispiel #2
0
    bool TryMove(TileMovingObjectScript TileObject, StinkyFile.SRotation Direction)
    {
        bool motionResult = TileObject.MoveInDirection(Direction, 1, 7);

        if (motionResult)
        {
            soundEffects.Play(0);
            var rotator = TileObject.GetComponentInChildren <AngleRotator>();
            if (rotator != null)
            {
                rotator.Rotate(Direction);
            }
        }
        return(motionResult);
    }