Added collision detection to ensure hero stays in bounds