Added detection for both sides including fliping sprite and changing movement.