Ejemplo n.º 1
0
 public bool CheckCollision(Wall wall)
 {
     //TODO Add properties to wall to calculate position of left and right wall
     return (X < wall.Left )
         || (X > wall.Right )
         ;
 }
Ejemplo n.º 2
0
        private void CheckEdgeCollision(Wall wall, double tunnelWidth)
        {
            if (wall.X + wall.Width >= tunnelWidth && _direction == Move.Right)
            {
                _direction = Move.Left;

            }
            else if (wall.X - wall.Width <= 0 && _direction == Move.Left)
            {
                _direction = Move.Right;
            }
        }