Created
March 25, 2014 18:16
-
-
Save ricardoquesada/9767824 to your computer and use it in GitHub Desktop.
how to create a 2d / 3d game in cocos2d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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