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 ) ; }
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; } }