Why do guys ignore you one day & then talk to you the next?

Okay so this is kinda long but PLEASE help me:

So I have a really big crush on this guy who goes to my school & we have been flirting back & forth for a long time now. I have only known him since September but I have really strong feelings for him. I mean I think about him basically everyday, I really like this guy. & I have told him probably about 3 times the way I feel about him but it seems like one day he talks, hugs & flirts with me & the next day he sees me (looks directly at me) & then doesn't say anything at all to me, like I'm not even there. This is SO frustrating & I've told him how this makes me feel but it doesn't seem to be changing at all. We have mutual friends & they all tell me that he likes me but I just don't see it! We are both only 17yrs. Old & I'm really not asking a lot, I'm not trying to have a serious relationship or anything like that. The only time I can seem to get his attention is if I ignore him for a day or two. PLEASE GIVE Me SOME ADVICE ON WHAT I SHOULD DO!
Why do guys ignore you one day & then talk to you the next?
Post Opinion