Beispiel #1
0
 private void DrawGameObject(ILaneObject gameObject, int laneX, int laneY)
 {
     Console.CursorLeft      = laneX + gameObject.LanePosition;
     Console.ForegroundColor = gameObject.Color;
     Console.Write(gameObject.Symbol);
     Console.ResetColor();
 }
Beispiel #2
0
        public bool IsInsideLane(ILaneObject laneObject)
        {
            var lanePosition = laneObject.LanePosition;

            var pastTowerCheck  = 0 <= lanePosition;
            var pastLengthCheck = lanePosition <= Length;

            var isInside =
                pastTowerCheck &&
                pastLengthCheck;

            return(isInside);
        }
Beispiel #3
0
 public static bool HasCollision(ILaneObject obj1, ILaneObject obj2)
 {
     return(obj1.LanePosition == obj2.LanePosition);
 }