He's probably trying to look cool in front of his friend. You know how some guys can be shady. They won't talk to you alone but when they are with friends, they feel like they need to prove themselves by showing off, doing ridiculous thing or talking to a random girl or girls.