He told my friend he likes me, but he didn't talk to me in class? Why did he do this?

My crush is good friends with my cousin and he told him that he thinks I'm pretty and he likes me. Our assigned seats changed in history so I have to sit by him. I tried to talk to him but he just either nodded his head or shrugged and he didn't even look at me while we were talking. He complained about how he had to redo his homework at the end of the lesson and that was all he said. Please can you give me advice on why he did this and what to do. :)
He told my friend he likes me, but he didn't talk to me in class? Why did he do this?
Post Opinion