I don't understand this
1.Play is a crucial part of development in most young mamals. Rats produce ultrasonic squeaks to prevent their scuffles turning nasty.
2. People laugh on fairground rides or when tickled to flag a play situation, whether they feel amused or not.
From 1st one, I'm not sure "to prevent their scuffles turning nasty"
From the 2nd sentence, I don't know the meaning "when tickled to flag a play situation"
Can anybody explain it me what that means?