Why does he suddenly ignore me in front of his friends?

so me and this guy are good friends, all of our friends hangout all the time so we are always around each other and we have first period together at school.

well for some reason he has started to ignore me in front of his friends, he used to talk to me all the time in front of them like yelling that we were going to be partners for bp or making fun of me like usual and just talking like normal. the last few times we have hung out he doesn't say hi just walks in and talks to everyone else and stares at me when I talk to him and acts weird. My friend said he liked me but then his friends said he doesn't and also when we hangout just him, me and one of my friends he was super talkative and sat next to me where his body was pressed against mine. and he still texts me sometimes usually for homework but for other things too.and the weird thing is he is totally normal in first period, where is friends aren't. he always pokes me or touches my waist or plays with my hair and always yells that we are going to be partners and got into a fight with my other friend about being partners with me. but why is he being so weird lately?