Why would he give me the cold shoulder?

i had feelings for this guy and I was pretty sure he had feelings for me. although, I was never completely sure. he would text me for hw, but then he would always get really flirty with the convo. then, we had an amazing time together at Homecoming:holding hands, togetherness, cuddling,etc. so I figured he was into me for sure especially because a week later he wanted to hangout with me outside of school, which we did. but after that, I was always so confused because when I'd see him at school, he'd act uninterested, kinda giving me the cold shoulder. but I noticed that if it was just us two and he'd see me or through texting, he'd be flirty and be happy to see/talk to me. but when we are in a big group of friends, he'd act not happy to see me, sometimes not even acknowledge me,like nothing was happening between us. after a few months of that, I called him out and told him that he likes to lead me on (this was during a text msg convo) and he never texted me back.so I gave him the... Show More