728x90 AdSpace

Latest Article

Space Game Tutorial cocos2d-x

The Space Game tutorial is available on Ray Wenderlich's site for both the cocos2d  i-phone and also for cocos2d-x Android.
I used the cocos2d-x tutorial as a baseline. http://www.raywenderlich.com/11338/cocos2d-x-for-ios-and-android-space-game
However, for my version of cocos2d-x it was not running so i tweaked it according to my needs.
The code available from the above link has accelerometer implementation and I have replaced that with keyboard and joystick.

Stuff I added:
A joystick to move the spaceship up and down.
A timer that gives the time in seconds.
The spaceship has three lives. If the spaceship collides with asteroids three times you loose the game.
The game is won if you are able to survive for 30 seconds.
The spaceship can be controlled with keyboard arrow keys as well.
The lasers are fired by touching/clicking on screen anywhere.

The source code is available on the link:



Space Game Tutorial cocos2d-x

  • Blogger Comments
  • Facebook Comments


  1. Sounds great, but your code doesn't run with the latest version of cocos2d-x. Are you planing to update it?

  2. Hey i also used the same tutorial from Raywenderlich. But when i made some changes in Helopworld.cpp its working properly in IOS but when i try to compile for android using Eclipse its not compiling properly. Pls help me out.