cocos2d-x入門
cocos2d-x,style
cocos2d-x,Game

You will know

  • How to enable multitouch
  • How to support both retina and non-retina displays
  • How to load images and sounds
  • How to play sound effects
  • How to create sprites
  • How to extend the Cocos2d-x Sprite class
  • How to create labels and update them

Game configurations

  • It must support multitouch since it's a two player game
  • It must be played on large screens since it's a two player game
  • It must support retina displays because we want to cash in on that
  • It must be played only in portrait mode because I built the art in portrait

Creating game project

  1. Open the terminal and create a new Cocos2d-x project called AirHockey that uses C++ as its main language.
    cocos new AirHockey -p com.Almond.AirHockey -l cpp -d /Users/Almond/Desktop/AirHockey

  2. Once the project is created, navigate to its proj.ios_mac folder and double-click on the AirHockey.xcodeproj file.

  3. Select the top item in Project Navigator and making sure the iOS target is selected, edit the information by navigating to General/Deployment info, setting the target device to iPhone and Device Orientation to Portrait and Upside Down.