public void checkCollisions()
    {
        // Check for collisions with walls.
        if (objects.isWallAtPosition(x, y))
        {
            x = oldX;
            y = oldY;
            inputDelay = 0;
            
            // Bounce off of any walls that the player runs into.
            switch (facing)
            {
                case UP:
                    facing = Direction.DOWN;
                    break;
                
                case DOWN:
                    facing = Direction.UP;
                    break;
                    
                case LEFT:
                    facing = Direction.RIGHT;
                    break;
                    
                case RIGHT:
                    facing = Direction.LEFT;
                    break;
            }
        }
        
        // Check for collisions with rupees.
        for (int i = 0; i < objects.rupees.size(); i++) 
        {
            Rupee rupee = objects.rupees.get(i);
            
            if (!rupee.increaseY && isCollidingWithPrecise(rupee))
            {
                // Start the collection animation for the rupee.
                rupee.increaseY = true;
                objects.audioManager.playRupeeSound();
            }
        }
    }