The Cocos2d-x Programmers Guide

Hello Everyone.

There has been discussion about better documentation. A while back Ricardo and I started a Programmers Guide.

The guide has 2 goals.

  1. A NEW user should be able to read the opening chapters and gain an understanding of how Cocos2d-x works and how to think about their game idea in Cocos2d-x concepts.

  2. An EXPERIENCED user might skip the opening chapters but the rest of the Programmers Guide would be broken down in to chapters that cover a specific topic, like Sprite or 3D or Physics in depth.

Here is the public GitHub: https://github.com/chukong/programmers-guide

Note:

  1. This is very much work in progress. I spend time on this everyday.
  2. Some of it is in Chinese and obviously I am translating this to English.
  3. There is a file outline.md that describes each chapter and what topics we are covering.

How do you help:

  1. Read Chapter 2 (2.md). This chapter we want to ensure that a new user can start with Cocos2d-x and understand the essential concepts. There are a few graphics at the end of ā€˜Parent and Child Relationshipā€™ that suck and I need to replace with ones that better demonstrate.
  2. Contribute artwork. Keeping it uniform across the whole guide is important.
  3. Pick a chapter and send PRā€™s to add/edit content. Help us refine the manual.

Iā€™m asking each and every user to spend time helping us out. Iā€™d love to go to Ricardo next week and say ā€œHey, I have more PRā€™s that I can handle.ā€, then open up a few red-bulls and get through them :smile:

As a Bonus, when we release this guide along with version 3.3:

  1. For the top 3 users that send useful PRā€™s I will send a Cocos2d-x t-shirt to.
  2. For the user whom I deem helped us out the most, I will have everyone in the US Office sign a Cocos2d-x t-shirt and send it to them.

Whoā€™s with me?

19 Likes

This documentation is really good! I am quite advanced but learned some things I would probably never find just by reading code.

Hi,
Well, call me ā€œThickie McThick, from ThickTownā€ but I donā€™t use Git usually, so Iā€™m not sure how to go about even reading what is there already - is there some sort of .md file editor somewhere I can use.

Cheers

Thanks for writing this. Appreciate the work youā€™re doing!

We are working hard on this. Ricardo is ensuring technical accuracy and overall flow. Iā€™m working with engineers to gather material as well as content, grammar, etc.

Chapter 2 is really important. If anyone has thoughts Iā€™d appreciate hearing them.

@Maxx - you can click each .md file and view it directly from GitHub. If you want to add content then I think you need to fork the repo and then submit a pull request with your changes.

If you are struggling, you could always e-mail me with your changes, thoughts and I can look at integrating it as I would will the pull requests.

@Maxx @slackmoehrle - if you just want to make an edit in one go, github letā€™s you click edit on any file and itā€™ll manage forking and creating pull requests for you :wink:

BTW, what do you guys think about putting all code samples in platform-independant (cocos2d-api-compliant) pseudocode? I think the C+Ā±only samples are something that may frighten newcomers.
Or, itā€™d be awesome if we could implement something like the code viewer over at MSDN (where you have a little box with tabs, and clicking each tab will show code samples for doing the same thing with different languages), althought I donā€™t know if this can be done with .md files (and itā€™ll be harder to maintain for sure).

We are talking about doing this. We need to get the rough form of the guide done so we can see how adding other languages would effect things.

1 Like

@ZippoLag - Thanks for the PR, btw.

No prob!

Hopefully itā€™ll be the first of many :wink:

@Manny_Dev - I received your PR to help with Chapter 13. What did you have in mind to help with?

I will add concepts and code examples of each of the subtopics that I added to chapter 13.

Hello, itā€™s really nice you add this.
Firstly, in Appendices, the start should be Prerequisites and not Android (Terminal) so all links miss the good target.

My question, as a mac user, I wanted to install a version on windows.
On G.md, you write VS 2012+ and I try on VS 2012 Express And Windows 8.1.
The problem is that VS2012 Express say it is not a valid project, so canā€™t make it as start up project.

Do I miss something ?

I had a little time and produced some docs draft myself. This is how I would approach it. Maybe you can take it as a suggestion or even build it up like this.

In the docs you can see several aspects like images, referencing to images and sections, inline code highlights and API documentation. By using typesetting frameworks you can create a consistent looking and professionally documentation, which is in sync with the actual API.

I uploaded a zip archive with pdf and html version in it.
cocos2d-x_docs.pdf is the pdf version.
cocos2d-x_docs_html.pdf is the html version.

docs.zip (480.7 KB)

@iQD Thatā€™s amazing, I donā€™t know why I bother, anyway, I have and although it is a drop in the ocean of your masterpiece it is for now and Iā€™d be grateful to find it in a footnote somewhere. http://johnbrown2000.wordpress.com/managing_eclipse_workspaces_wrt_cocos2dx/

Could we combine Markdown and Sphinx to generate docs?

Well, Sphinx uses reStructuredTextreStructuredText as itā€™s format. You could use Pandoc to convert from Markdown to reST and feed that into Sphinx.

There are other sundry differences between them, but you can read about the major ones here:
http://www.unexpected-vortices.com/doc-notes/markdown-and-rest-compared.html

Sphinx supports many features through extensions, which rely on reST. You would have to look how Pandoc would convert them. E.g. the pictures in my doc are not drawn, but programmed/generated through typesetting with TeX/LaTeX/TikZ/PSTricks.

Glad you like it, but itā€™s far from perfect. I canā€™t follow you completely. What is it you are asking for? You want me to include your blog into my docs or do you want my doc included into your blog?