Why does he try to pretend like he doesn't see me?

Okay, why would a guy pretend like he doesn't see/notice a girl?

It's so silly!

Back story:

There's this guy who's like a friend/acquaintance of mine, and we know each other fairly well (it's not like we're strangers or anything). We have fun together sometimes, and we're usually cool together.

Well, one day not too long ago, I saw him out at an event that mutual friends of ours got together. Since he was the only one there (aside from my friends) that I knew, I decided to walk near him and maybe say hello and start a conversation. I KNOW he saw me because (duh) I was right in front of him! lol. But when I looked at him to say hello, he was looking out into space...okay weird. Anyway, I KNOW he saw me because he had this funny slight smile on his face.

Since he didn't say anything, I decided not to say anything either and started to leave and talk to someone else. THEN that's when he says: "Hey Mystique". That's how I KNOW he saw me the first time! I just look at him and say hello back. He smiles and seems normal, but since he ignored me at first I didn't say anything else.

Ugh...why would a guy pretend like he didn't see a girl? Why do guys do this?