Cocos2d-x Study Notes

Source: Internet
Author: User

Cocos2d-x is a good cross-platform game engine, more information can view the Chinese official website, there are a lot of tutorials, but the layout is not very good, it is not convenient to view all, write a script to catch it, generate a simple web page for easy global viewing. The Code is as follows:

# -*- coding: utf-8 -*-import urllib2firsturl="http://cn.cocos2d-x.org/"def main():    file = open("index.html","w")    writehead(file)    writetable(file)    writeend(file)    file.close()def writetable(file):    file.write(‘<table width="100%" border="2" cellpadding="2" cellspaceing="0">‘)    result = urllib2.urlopen(firsturl+"tutorial/index")    line = result.readline()    while line:        if ‘<a href="/tutorial/lists?id=‘ in line and ‘<td>")            file.write(line.replace("/tutorial",firsturl+"/tutorial"))            cuturl = firsturl+line.split("href")[1].split(‘"‘)[1]            result2 = urllib2.urlopen(cuturl)            line2 = result2.readline()            file.write("</td><td><ul>")            while line2:                if ‘<a href="/tutorial/show?id‘ in line2 and ‘&gt;<‘ in  line2:                    tempurl2 =firsturl+line2.split(‘&gt‘)[0].split(‘"‘)[-2][1:].replace("amp;","")                    print tempurl2                    result2 = urllib2.urlopen(tempurl2)                line2 = result2.readline()            file.write("</ul></td></tr>")        if ‘<a href="/tutorial/index?level=0&type=cocos2d-x&amp;per_page=‘ in line and ‘>&gt;<‘ in line:            tempurl = firsturl+line.split(‘&gt‘)[0].split(‘"‘)[-2][1:].replace("amp;","")            result = urllib2.urlopen(tempurl)            #print tempurl        line =result.readline()    file.write("</table>")def writehead(file):    file.write(‘‘‘<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

After a simple and crude crawling, I thought it was better to figure out the relationship between classes. So I found a good thing called doxygen, which is very easy to use and generates HTML documents from the source code.

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.