Cocos2d installation environment preliminary

Source: Internet
Author: User

As we all know, this is an open-source game engine currently popular. It is used to develop any application of 2D game Boxes Based on 2D graphics. It is implemented in python. It is famous because of the popularity of the iphone and the iphone version it specifically launched for it. If you cannot use the iphone version with restrictions, you can use cocos2d. Official website is http://cocos2d.org/ At a glance, you can see that the latest version is 0.5.5, download it, unzip, In the cocos2d-0.5.5 \ doc \ html \ programming_guide \ index.html to see the document. The second section tells me that If this is your first time reading about cocos2d, we suggest you start at Writing a cocos2d application. okay, I'm curious. I'm not prepared for anything. Let's see how to write a cocos2d application first. Can I understand it? You can see it. You can find the entire program in the samples/hello_world.py file. the first program introduced here is hello world. I found this file smoothly and double-click it to run it. The program flashed through. I think there is a problem, just run it with the command line, print a few lines of errors: [plain] D: \ GameDev \ cocos2d-0.5.5 \ samples> hello_world.py Traceback (most recent call last ): file "D: \ GameDev \ cocos2d-0.5.5 \ samples \ hello_world.py", line 11, in <module> import cocos File "D: \ GameDev \ cocos2d-0.5.5 \ samples \.. \ cocos \__ init __. py ", line 66, in <mod ule> import OS, pyglet ImportError: No module named pyglet File import error. It turns out pyglet is not found. What is the pyglet? The official website is located at a cross-platform processing wing and multimedia library for Python. It is very likely that this library is not available in my system. Please download and install it. The latest version is pyglet-1.1.4. I downloaded a windows Installation File directly, prompting me that it is dependent on python2.4 and updated. It's strange. In my system, the latest version of python 3.3 is available. Okay, maybe it's too new, not supported. I downloaded python2.7.3 again and thought it was okay. It was just an error after installation. I suspect that the environment variables are not properly configured and everything works properly after the check. Then, I will download the source code and compile it myself. [SQL] After python setup. py install is complete, run hello_world.py again! Cute hello world! The window finally came out. The environment has been set up. Continue to explore...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.