Skip to content

Commit

Permalink
re-organized chapter numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
slackmoehrle committed Aug 20, 2014
1 parent 71e24b9 commit d31b725
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 476 deletions.
10 changes: 5 additions & 5 deletions 10.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Chapter 10: Lua
# Chapter 10: 3D

## call custom c++ from Lua
## 3D Sprite

## bindings to c++
## 3D Actions

## subclassing
## 3D Animations

## Placeholders for: memory management, Debug a Lua Game
## Placeholders for: Lights, Shadows, Cameras


10 changes: 6 additions & 4 deletions 11.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Chapter 11: Services
# Chapter 11: Lua

## other SDK's
## call custom c++ from Lua

## Plugin-X
## bindings to c++

## Placeholders - IAP, FB
## subclassing

## Placeholders for: memory management, Debug a Lua Game


12 changes: 4 additions & 8 deletions 12.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Chapter 12: Physics
# Chapter 12: Services

## What options and why integrated physics engine
## other SDK's

## Physics concepts
## Plugin-X

## Physics world, bodies

## Collision

## Examples
## Placeholders - IAP, FB


22 changes: 8 additions & 14 deletions 13.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# Chapter 13: Advanced Topics
# Chapter 13: Physics

## Best Practice - Optimization, memory, performance, profiling
## What options and why integrated physics engine

## Sound
## Physics concepts

## SQLite
## Physics world, bodies

## Subclass Cocos2d-x classes
## Collision

## Data structures (i.e Vector)

## Custom OpenGL (what to cover here? CustomCommand?)

## c++11 usage

## rendering pipeline (notes about this in the wiki)

## networking - curl, http
## Examples


19 changes: 19 additions & 0 deletions 14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Chapter 14: Advanced Topics

## Best Practice - Optimization, memory, performance, profiling

## Sound

## SQLite

## Subclass Cocos2d-x classes

## Data structures (i.e Vector)

## Custom OpenGL (what to cover here? CustomCommand?)

## c++11 usage

## rendering pipeline (notes about this in the wiki)

## networking - curl, http
132 changes: 1 addition & 131 deletions 2.md
Original file line number Diff line number Diff line change
@@ -1,131 +1 @@
# Chapter 2: Jumping into Cocos2d-x

## Installation

[Appendix A - Android with Terminal Installation and Setup]()

[Appendix B - Android with Eclipse Installation and Setup]()

[Appendix C - iOS Installation and Setup]()

[Appendix D - Mac OSX Installation and Setup]()

[Appendix E - Linux Installation and Setup]()

[Appendix F - Win32 Installation and Setup]()

[Appendix G - WP8 Installation and Setup]()

[Appendix H - Creating a New Example Project]()

## Getting Started
This introduction requires a working Cocos2d-x setup to complete. Please ensure that you have gone through the appropriate installation steps for your platform. Please review the Appendix for `Installation Guides`.

Follow Appendix H for 'Creating A New Example Project'.

Navigate to your new project and open it. This is dependepent upon the platform that you are running on. Please refer to the appropriate Appendix for your installation.

Let's Begin!

## What is in the Project
Everything you need to get started! Platform specific source files, Cocos2d-x and the Resources used in the 'Hello World' sample.

![](2/2_1.png "Hello World Project in XCode")
## Creating Your First Scene
'Hello World' has a default Scene, but lets ignore it and create our own.

`File -> New -> File` or `Command-N` and lets create a C++ class.

![](2/2_2.png "New C++ class")

Select `Next` and let's call our new Scene `MainScene.cpp`.![](2/2_3.png "Name the new class")

Select `Create`.

Select the `MainScene.h` and paste in the following code:

```cpp
#ifndef __MAINSCENE_H__
#define __MAINSCENE_H__

#include <iostream>

#include "cocos2d.h"

class MainScene
{
public:
MainScene();
~MainScene();

static cocos2d::Scene* createScene();

virtual cocos2d::Scene* getScene() { return scene; };

private:
cocos2d::Scene* scene;
cocos2d::LayerColor* layer;
};

#endif // __MAINSCENE_H__
```
Select the `MainScene.cpp` and paste in the following code:
```cpp
//
// MainScene.cpp
//

#include "MainScene.h"

MainScene::MainScene()
{
// get the display size of the device we are using
cocos2d::Size visibleSize = cocos2d::Director::getInstance()->getVisibleSize();
cocos2d::Vec2 origin = cocos2d::Director::getInstance()->getVisibleOrigin();

// scene
scene = cocos2d::Scene::create();
scene->setContentSize(visibleSize);

// layer
layer = cocos2d::LayerColor::create(cocos2d::Color4B(120, 50, 50, 120), visibleSize.width, visibleSize.height);

// finally add the built up Layer to the Scene.
scene->addChild(layer, 0);
}

MainScene::~MainScene() {}

cocos2d::Scene* MainScene::createScene()
{
MainScene m;
return m.getScene();
}
```
And finally, in `AppDelegate.cpp`, replace:

```cpp
auto scene = HelloWorld::createScene();
```
with:
```cpp
cocos2d::Scene* scene = MainScene::createScene();
```

That's it! But the Scene is empty. Lets add some content.

## Adding Content to the SceneLets start to make a simple game!

First, download <> and toss the contents in the `Resources` directory for your project. Add them to your IDE.

Second, past in the following code:

```cpp

```
## Using Actions to Animate Scenes

## Transitioning Between Scenes
## Building Complex Content Using Nodes

## Creating Nodes That Interact with Each Other
# Chapter 2: Basic Cocos2d-x Concepts
Loading

0 comments on commit d31b725

Please sign in to comment.