Home Database Mysql Tutorial Mac下搭建cocos2d 和cocos2d

Mac下搭建cocos2d 和cocos2d

Jun 07, 2016 pm 03:17 PM
mac build

因为想了解下cocos2d游戏开发,所以最近准备学习学习,cocos2d和cocos2d-x cocos2d 是一个开源框架,用于构建 2 D 游戏、演示程序和其他图形界面交互应用等。Cocos2D 是 iPhone 开发中一个非常有用的库,它可以让你在创建自己的 iPhone 游戏时节省很多的时间

 因为想了解下cocos2d游戏开发,所以最近准备学习学习,cocos2d和cocos2d-x

       cocos2d是一个开源框架,用于构建2D游戏、演示程序和其他图形界面交互应用等。Cocos2DiPhone开发中一个非常有用的库,它可以让你在创建自己的iPhone游戏时节省很多的时间。它具有很多的功能,比如sprite(精灵)扶持,非常酷的图形效果,动画效果,物理库,音频引擎等等。 官方图标你完全可以免费把它用于商业开发而获得收益。复杂讲,Cocos2d-iPhone是基于 GNU LGPL v3 license的,考虑到在iPhone的平台上无法实现发布第三方动态链接库,因此他扩展了上述协议,允许通过静态链接库或者直接使用源代码的方式实现你的应用,而不必公开你的源代码。你不用担心这个开源引擎的效率和可能存在的内在限制,因为:在AppStore上已经有超过100个游戏是基于Cocos2D-iPhone。其中3个由此进入过TOP10的排名。其中的 StickWars更是曾排名第一。

         Cocos2d-X是一个开源的移动2D游戏框架,MIT许可证下发布的。这是一个C++ cocos2d-iPhone项目的版本。cocos2d-X发展的重点是围绕cocos2d跨平台。cocos2d-X提供的框架外,手机游戏,可以写在C+ +或者Lua中,使用APIcocos2d-iPhone完全兼容。cocos2d-X项目可以很容易地建立和运行IOSAndroid的三星Bada,黑莓表操作系统和更多。cocos2d-X还支持WindowsLinux,因此,我们可以调试的源代码很容易写在桌面操作系统的编辑。

  “X”,也意味着交叉。这个开源项目的目标是让用户创建跨平台的代码。目前支持的平台是在iPhoneAndroid的,WoPhoneWin32平台上,但可根据要求提供更多的平台。


cocos2d 下载地址  http://www.cocos2d-iphone.org/download

coco2d -x 下载地址 http://code.google.com/p/cocos2d-x/downloads/list


下载cocos2d 的时候建议下载稳定版本的,这样以防应用程序出现崩溃情况


cocos2d和cocos2d -x 的环境搭建一样,下载后打开压缩包,然后右键拷贝文件,复制路径,打开终端,进入文件


比如我的路径

cd  /Users/rjxy/Documents/cocos2d-iphone-2.0 

然后 sudo  ./install-templates.sh 

提示输入密码,输入后回车即可完成安装

因为先安装的是cocos2d -x 在安装cocos2d的时候出现错误(并不是先zhuanglcocos2d-x  后装cocos2d一定会出错,这是我在装的时候出现的问题)

[cpp] view plaincopy

  1. cocos2d-iphone template installer  
  2.   
  3. Error: Do not run this script as root.  
  4.   
  5. 'root' is no longer supported  
  6.   
  7. RECOMMENDED WAY:  
  8.  ./install-templates.sh -f  


 在网上查了原因,解释说因为 install-templates.sh 文件中以下代码判断root权限有问题,打开install-templates.sh这个文件,在安装包里找到该文件,打开再找到这样一段代码,然后删除这段代码就可以顺利安装了

[cpp] view plaincopy

  1. # Make sure root is not executed  
  2. if [[ "$(id -u)" == "0" ]]; then  
  3.     echo ""  
  4.     echo "Error: Do not run this script as root." 1>&2  
  5.     echo ""  
  6.     echo "'root' is no longer supported" 1>&2  
  7.     echo ""  
  8.     echo "RECOMMENDED WAY:" 1>&2  
  9.     echo " $0 -f" 1>&2  
  10.     echo ""  
  11. exit 1  
  12. fi  

或许我们在第一次安装的时候也会出现这种情况,以同样的办法解决;

我们就可以在新建工程侧栏中选择cocos2d工程


Mac下搭建cocos2d 和cocos2d


Mac下搭建cocos2d 和cocos2d


然后新建两个工程,一个cocos2d和cocos2d -x 的工程,运行测试一下效果


cocos2d


Mac下搭建cocos2d 和cocos2d



cocos2d -x


Mac下搭建cocos2d 和cocos2d


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

No response when entering password on mac keyboard? No response when entering password on mac keyboard? Feb 20, 2024 pm 01:33 PM

Introduction: In this article, this website will introduce to you the relevant content about the Mac keyboard not responding when entering passwords. I hope it will be helpful to you, let’s take a look. How to solve the problem that the password cannot be entered on the Apple Mac system? You can also try to connect this keyboard to other computers to see if it works normally. If the same problem occurs on another computer, it's most likely a fault with the keyboard itself. You may consider replacing the keyboard or repairing it. The first time you log in to Alipay with your Mac computer, you will find the login interface and cannot enter your password. The password input field displays: "Please click here to install the control", so Alipay login requires the installation of security controls. Security controls can encrypt and protect the information you enter (amount, password, etc.) to improve account security. Tie

3 tips to easily customize your Mac computer name, host name and Bonjour name 3 tips to easily customize your Mac computer name, host name and Bonjour name Mar 06, 2024 pm 12:20 PM

Many Mac users tend to keep the default name of their device and may never consider changing it. Many people choose to stick with the name from the initial setup, such as "Johnny's MacBook Air" or simply "iMac." Learning how to change the name of your Mac is a very useful skill, especially when you have multiple devices, as it can help you quickly distinguish and manage them. Next, we will teach you step by step how to change the computer name, host name and Bonjour name (local host name) in macOS system. Why should you change your Mac name? Changing the name of your Mac can not only show your personality, but also help improve the user experience: Personalize your Mac: The default name may not be to your taste, change it to a name you like.

pkg file to install on mac? pkg file to install on mac? Feb 20, 2024 pm 03:21 PM

Preface: Today, this site will share with you the relevant content about installing pkg files on Mac. If it can solve the problem you are facing now, don’t forget to follow this site and start now! The previous version of macos pkg cannot be installed to upgrade the operating system: If your laptop is using an older operating system version, it is recommended to upgrade to the latest operating system version. Because older versions may not support installation of the latest macOS system. Select "Erase" in Disk Utility, then select the Macos extension in the format, do not check the encryption option, and do not select the apfs format, and finally click the "Erase" button to solve the problem of being unable to complete the macOS installation. Drag the application's icon to the file starting with App

How to set up WeChat Mac to automatically convert voice messages into text - How to set up voice to text conversion How to set up WeChat Mac to automatically convert voice messages into text - How to set up voice to text conversion Mar 19, 2024 am 08:28 AM

Recently, some friends have consulted the editor about how to set up WeChat Mac to automatically convert voice messages into text. The following is a method for setting up WeChat Mac to automatically convert voice messages into text. Friends in need can come and learn more. Step 1: First, open the Mac version of WeChat. As shown in the picture: Step 2: Next, click "Settings". As shown in the picture: Step 3: Then, click "General". As shown in the picture: Step 4: Then check the option "Automatically convert voice messages in chat to text". As shown in the picture: Step 5: Finally, close the window. As shown in the picture:

Mac configuration file does not take effect? Mac configuration file does not take effect? Feb 20, 2024 pm 02:00 PM

Introduction: This article will introduce to you the relevant content about the mac configuration file not taking effect. I hope it will be helpful to you, let's take a look. The solution to the problem that environment variables cannot take effect under Mac. After configuring environment variables in the Mac system, it is found that they are only effective in the current terminal and will become invalid once the terminal is switched. After inquiry, it was found that the Mac system is pre-installed with a tool called ultimate shell-zsh, and the reading of environment variables needs to be set in the .zshrc file. 2. In order for our configuration file to take effect, we can only add the above configuration in .zshrc. If you don’t make the above settings, you will find that it will only take effect every time you source ~/.bash_profile. Re-open z next time.

3 Ways to Convert HEIC Photos to JPG on Mac 3 Ways to Convert HEIC Photos to JPG on Mac Mar 15, 2024 pm 08:43 PM

By default, iPhone takes photos from the camera in HEIC format. HEIC stands for High Efficiency Image Container and can hold more pixel data than PNG or JPG files, taking up significantly less space on iPhone storage compared to other formats. These files work best on iPhones but are not widely accepted on the internet because they often result in blurry/grainy pictures when you share them with non-Apple devices. To ensure that HEIC images are compatible on other devices, you may need to convert them to JPG format. This article will introduce how to convert HEIC images to JPG on Mac. How to Convert HEIC Photos to JPG on Mac [3 Methods] Method

vmmac virtual machine full screen (how to full screen virtual machine macos) vmmac virtual machine full screen (how to full screen virtual machine macos) Feb 20, 2024 pm 01:15 PM

Preface: Many friends have asked questions about the full screen of the vmmac virtual machine. This article will give you a detailed answer for your reference. I hope it will be helpful to you! Let’s take a look! Mac virtual machine Overwatch has no screen reason: graphics card compatibility issue. If you used to run Overwatch normally but now have a black screen, it may be due to a faulty graphics driver. Solution: Check whether the graphics card supports the game requirements. Update graphics card driver. Try using a different power supply to rule out the second possibility. Check whether there are any abnormalities on the motherboard, such as whether the capacitor is bulged (may have been broken down), whether there is obvious damage to the surface of the motherboard, causing circuit interruption, etc. It is recommended to send the motherboard to a repair station for inspection. If conditions permit, you can consider replacing it with another one.

Can't open compressed files on mac? Can't open compressed files on mac? Feb 20, 2024 pm 02:18 PM

Introduction: This article is here to introduce you to the related content about Mac compressed files that cannot be opened. I hope it will be helpful to you, let’s take a look. Why can't I open the decompressed rar file on Mac? Since you don't have Mac decompression software, I would like to recommend a Mac version of decompression software to everyone. It is similar to commonly used compression software on Windows such as 360 Compression. Simply open the file and unzip it easily. The operation steps for Apple Mac computers that cannot open RAR files are as follows: First, install the RAR file decompression application, and you need to enter your Apple ID account and password to complete the installation. In the second step, after the installation is complete, return to the Mac desktop and double-click the RAR file to open and decompress the file contents. 3. Turn on the power

See all articles