Updated the player class with simple collision detection.