Military Relationship

I met my boyfriend at basic training, we got together after I graduated AIT. I'm national guard, he's active duty. We made our long distance relationship work very well until he left for his duty station in Alaska. Everything changed, he treats me different and he ignored me at times. Seems like things only got worse during and after his deployment. I've flown to Alaska to see him before he left and when he came back, but it seemed like he only wanted sex from me. I love him and I want to be with him but I don't know how to change things for the better. Any advice or tips?