What would make someone switch between two personas this way?

He was into me in the beginning and was trying to get my friends to help him out. He was very persistent and flirty and was so much so that I thought he was a douchey player. He had that kind of appearance and personality.

However, one night we were up in his room, just the two of us, to work on a school project and instead of working on the project, we were having a blast talking for hours, with an endless conversation, not awkwardness and I really felt connected with him because we were talking about similar interests. It was a lot of laughs and he even hugged me goodbye as I left. I realized that he is not a douchey guy, he is actually sweet and deep!

But since that night, he's been acting really strange around me. Like awkward. I don't know it's weird. He seems different whenever I talk to him now and I'm not sure why, like he's vulnerable or something... Any ideas as to why?
Updates
+1 y
avoidant may be a good word
What would make someone switch between two personas this way?
Post Opinion