Why does he act like this?

Ok so first when I had class with this guy (who is a year younger than me) he was really nice like he would go get the work in front of the class for me and he would smile around me a lot (our teacher puts our assignments in the front and we have to get them). I told him that someone stole my notebook and he actually seemed concerned. He would do small sweet things like that. But one day I remember he wouldn't let me sit next to my guy friend (we aren't that good of friends anyway). Then one day he kinda yelled at me (it wasn't loud and nobody heard, but it was rude) because he was nervous about something the teacher said to him. So I told him to calm down and don't let our teacher intimidate him and I was mad so I told him to leave me alone. So the next day when he came in he looked at me but I was still pissed so I ignored him for a while. So he stopped doing the sweet little helpful things he used to and stopped talking to me (this wasn't going on for a long time). Then just started looking at me a lot. Now when I talk to him he is serious and stern at first but after a bit he loosens up and starts smiling again. And when I laugh/smile he smiles at me, but he rarely says hi to me first now.

He said he hates the class we are in that's why he's so serious and bored, but he is also in the club they have after school... by choice! But a lot of people in the class are like that.

So why does he act like this?
And what should I do?
Why does he act like this?
Add Opinion