goglplate.blogg.se

Vector 2d tutorial
Vector 2d tutorial








vector 2d tutorial

Open AppDelegate.cpp and find the following line inside AppDelegate::applicationDidFinishLaunching: Porting this project to other platforms is a trivial (yes, trivial!) matter discussed briefly at the end of this tutorial.īuild and run your app to see the template project in all its glory:īy default, Cocos2d-x games are named “MyGame” and have a resolution of 960×640, but those details are easy to change. While Cocos2d-x is capable of building games for many platforms, in this tutorial you’ll focus on making an OS X app.

VECTOR 2D TUTORIAL MAC

Once you’re Inside Xcode, ensure that SimpleGame Mac is the active scheme, as shown below: You can also learn about any subcommand’s options by appending “-help” or “-h”, such as cocos new -h to see the options for the new command.ĭouble-click ~/Cocos2d-x-Tutorial/SimpleGame/proj.ios_mac/SimpleGame.xcodeproj in Finder to open the project in Xcode. Note: To learn about the available cocos subcommands, type cocos -help or cocos -h. This creates a directory named Cocos2d-x-Tutorial in your home directory, and inside that, a sub-directory named SimpleGame that contains your project’s files. Run the following command to create a C++ game template named SimpleGame:Ĭocos new -l cpp -d ~/Cocos2d-x-Tutorial SimpleGame Now you can call the cocos command in Terminal from any directory. The command you entered simply re-processes your shell configuration and gives it access to the new variables. Source ~/.zshrc (or source ~/.bash_profile) A great timesaving tip: you can use a tilde ( ~) in place of /Users/your_user_name, so to save keystrokes you could type the following: In the above screenshot, the setup package prompts for “source /Users/rwenderlich/bash_profile.” commands since I’m using Bash, but had I been using Zsh, for example, it would have prompted me to run “source /Users/rwenderlich/.zshrc”.Įnter the command as the script’s output instructed. Note: Depending on which shell you use, you might see some different output.










Vector 2d tutorial