Confused about a guy an what's going on.. Need to work him an the situation better?

I've known him for nearly 2 years at the start it was great we spoke all the time went out did stuff together he even asked me to be his girlfriend I was scared an nervous an didn't answer carries on talking like he hadn't he was fine about it, still chatted like we always did... I then went out with friends to where he worked he's a doorman.. I got chatting to another guy who I knew liked me in the past, an I knew the guy who I liked could do nothing about it apart from watch Because he was working, I suppose I waned to make him jealous, needless to say he didn't talk to me the rest of the night he then text me saying he was jealous an I gave him the cold shoulder.. a few days later I got the whole I wannabe be friends an I care about you an I always be here for you text.. I was hurt! My own fault I guess. Anyways he moved clubs for awhile an I never saw him I got over it. I thought about him beat myself up about what I did but carried on.. he's since come back to my town to a club I go too, hit me like a bus! So we got back to talking all the time even met up a couple times he even said I still really like you a couple times made me happy! However that faded out an now he only tries to get my attention when I'm out with friends having fun like flirting touching me as I go by cuddles etc even has been known to text me while I'm stood to feet away from him an that will carry on all night next day he hardly says 2 words to me! This happens every time go out! Why does he want my attention when I'm out an then not when he hasn't seen me? Out of sight out of mind? I don't understand! Obviously still hooked on him! Help me understand!

Updates:

Ok I understand your answers and they've helped. But before I'm judged an I except his behavior is my fault, he had a part to play in this like seeing a girl when he said he was single I saw him calling another girl his Girlfriend on a social networking site, he knew I'd see that! Told me couldn't meet me because he was with family he wasn't he was with her, again social networking site. Also listened to a mate say they was seeing each other he might as well laughed in my face. He played games too!

To be honest, it was really dumb of you to give him such a cold shoulder after he asked you to be his girlfriend, especially if you wanted to be. Then you still act into him. Then you let another guy hit on you in front of him. You're really f***ing with his head, and that's messed up.

Anyways. Like I said, you've f***ed his up pretty hard. He doesn't know how to approach you anymore. That's why he keeps sporadically talking to you. If you still really like him, you need to talk to him. Tell him you really like him, and that you want to date him. Then stick with it. If you don't want to be with him, tell him that. And you'd like to be friends. Give him some closure.

To be honest if I was talking to him, I would tell him to get over you and move on. You're not healthy for him.