Skip to content

Instantly share code, notes, and snippets.

@ricardoquesada
Created March 25, 2014 18:16
Show Gist options
  • Save ricardoquesada/9767824 to your computer and use it in GitHub Desktop.
Save ricardoquesada/9767824 to your computer and use it in GitHub Desktop.
how to create a 2d / 3d game in cocos2d
### Option 1
### director has a mode
def appdelegate:
# Projection / Camera is part of director
# Scene checks this value in order to create the correct Physics world
director.setMode(2D)
director.runScene( MyScene() )
class MyScene( Scene ):
def init(self):
do_something()
### Option 2
### director doesn't have a mode
### 2D/3D is controlled by Scene
def appdelegate:
director.runScene( MyScene() )
# subclasses Scene2D
# scene2d sets a 2D projection/camera
# scene2d uses a 2d PhysicsWorld
class MyScene( Scene2D ):
def init(self):
do_something()
### Option 3
# something else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment