Why does he suddenly flirts with other girls in front of me?

Anonymous
TLDR: There is a guy in class who keeps initiating conversations with me, and hovering in places around me, however, he overheard I liked another guy (which I don't, but I didn't really say no), and he suddenly keeps flirting with other girls in front of me.

DETAILS:

I am classmate with this guy, and we have a very decent relationship throughout the first few weeks of school. He keeps initiating contacts with me, asking me to join in his conversation, and constantly stays around me.

There were girls that flirts with him, but he always shoo them away? Saying things like "go do your school work", or when another girl borrowed his pen, he would throw it at her but when I needed to borrow his eraser, he walked by to my table to give it to me although me and the previous girl is on the same table.

Well anyways, we were close.

A few days ago, a friend of mine walked to my desk (he sits across from me) and says "I know who you like," and she mentioned the name of the guy that wasn't him. And I wasn't sure what to answer, so I jokingly flirted with her saying "The one I love is you~" without denying it.

The next day he suddenly becomes cold.

He keeps flirting with other girls in front of me. During our class free time, I was beside a friend of mine (a girl), and he called her over (she is the same girl he shooed away by asking her to do her work), and the next day when he was behind the teacher's table and the teacher called me, he suddenly approached this girl and talked to her. When I returned to my seats, however, he stopped talking to her, and moved slightly to the left where he could directly see me.

He never talks to me anymore after that incident. I once moved to the seat behind him to see if he would ask me to talk or anything, and he didn't, but he kept turning his face, and once smiled when I made a joke, but when I directed one to him, he looked all cold and mean.

Why is this?

Also, what should I do so he doesn't act like this anymore?
Why does he suddenly flirts with other girls in front of me?
4 Opinion