Check out this tutorial. It demonstrates what you are asking about.
http://www.raywenderlich.com/3611/how-to-make-a-space-shooter-iphone-game
Actually, I just noticed that you listed Cocos2D-X, which I am unfamiliar with. I don't know if the referenced tutorial will help, but I will leave the reference in case it does.