Relationship issuses

So me and my boyfriend barely talked until we started being more oepn about sex and now we stated having sex , we were both virgins. When we started having sex ( weve only done it 2 times ) he was being veryy nice and coming over all the time and telling me how beautiful i was and for the past 3 days adter having sex the second time he was being a dick telling me i need to start hanging out with friends more and he doesnt wanna come over that much because theres nothing to do and just being mean but all of a sudden yesterday hes nice again saying he still wants to come over because we can have sex and he misses me and he wants to have sex again. It seems like when he doesnt want sex hes a dick but when he does hes nice. Does he just want me for sex ?