Cocos2D

= Releases =
 * http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_99_5

= Overview =

Application

 * Generally, one starts by initializing the CCDirector singleton
 * A scene must be added to the director which is composed of layers which in turn, contain sprites and other nodes
 * Scenes, layers and sprites all extend the CCNode which has a lot of inherent functionality

Timing
[scene schedule:(step:)]; // ... - (void)step:(ccTime*)time { updateStuff; // render isn't generally necessary? }
 * For the game loop, one generally schedules an update method from within the current scene or whatever whomever the relevant nodes owner would be

CCDirector
- (void)runWithScene:(CCScene*)scene; - (CGSize)winSize;
 * The app delegate generally initializes the CCDirector as needed for the application.
 * set the type
 * set the texture
 * set the depth buffer
 * set the pixel format
 * set the device orientation
 * set the animation interval
 * display FPS* CCDirector is generally a singleton and accessed as.
 * Modern Cocos2D apps default to the DisplayLink - some older directors calculate a game loop based on an NSTimer while more modern directores are based on the DisplayLink.
 * The CCDirector also handles scene transitions

@property (..) CCDeviceOrientation deviceOrientation; @property (..) float animationInterval; @property (..) BOOL displayFPS;

CCNode
[scene addChild:layer]; [layer addChild:sprite]; - (void)onEnter; - (void)onEnterTransitionDidFinish; - (void)onExit; [node schedule:@selector(doSomething) interval:1];
 * Most everything in a Cocos2D app is a subclass of a CCNode. That includes CCScene, CCLayer and CCSprite.
 * Can contain other CCNodes, schedule periodic callbacks and execute 'actions'
 * Properties include anchor point, position, scale, rotation, visible, z-order
 * As nodes are added or removed, a few callbacks are invoked:
 * Nodes can schedule methods (how do you determine the exact interval that has passed?)

CCScene
CCDirector *dir = [CCDirector sharedDirector]; [dir replaceScene:[GameScene node]]; // ..or [dir replaceScene:[CCTransitionFade transitionWithDuration:2 scene:[GameScene node] withColor:ccRED]]; // ..or [dir replaceScene:[CCTransitionZoomFlipAngular transitionWithDuration:2 scene:[GameScene node] orientation:kOrientationLeftOver]];
 * Access via
 * Add appropriate layer in scene init method
 * Can you add more than on layer - in which case, they'd be layered?
 * Transition example:

CCLayer

 * Responsible for handling touches and accelerometer events.

CCSprite

 * Generally added to a layer (which belongs to a scene)
 * Used for displaying images. Create a CCNode that contains a CCSprite. CCNode extension can include several other properties that a CCSprite wouldn't necessary care about. The Game, etc. Generally add node to the game (layer) and then add the sprite to the node ??? how does the sprite get positioned? relative to it's parent node which, in turn, sits on the layer?
 * Supports multiple pixel formats, opengl textures, file images, CGImages and Spritesheets
 * CCTargetedTouchDelegate: a protocol that your sprite can implement that responds to touches

actions
[layer addChild:sprite1]; sprite1.opacity = 0; [layer addChild:sprite2]; sprite2.opacity = 0; [layer addChild:sprite3]; sprite3.opacity = 0; // ... CCSequence *action1 = [CCSequence actions:[CCDelayTime actionWithDuration:2], [CCFadeOut actionWithDuration:1], [CCCallFuncN actionWithTarget:self selector:@selector(blah:)], nil]; [sprite1 runAction:action1]; CCSequence *action2 = [CCSequence actions:[CCDelayTime actionWithDuration:2], [CCFadeIn actionWithDuration:1], [CCDelayTime actionWithDuration:2], [CCCallFuncND actionWithTarget:self selector:@selector(blah:data:) data:images], nil]; [sprite2 runAction:action2];
 * Transition example with sprites and actions:

CCLabel

 * A Cocos2D label based on a CCNode.

Helper
ccp(x, y)
 * ccp(...) creates a CGPoint

= Notes =

Gorillas

 * https://github.com/Lamentum/Gorillas/wiki

Stack Overflow

 * http://stackoverflow.com/questions/691648/how-to-draw-a-line-with-cocos2d-iphone

General

 * http://cocos2d.org/doc/programming_guide/effects.html#index-of-grid-effects
 * http://stackoverflow.com/questions/1081832/how-to-draw-a-solid-circle-with-cocos2d-for-iphone
 * http://www.cocos2d-iphone.org/forum/topic/6403

Python

 * http://wiki.python.org/moin/PythonGames
 * http://www.pysoy.org/
 * http://www.panda3d.org/
 * http://www.blender.org/documentation/249PythonDoc/GE/index.html

Competition

 * http://irrlicht.sourceforge.net/features.html
 * http://slick.cokeandcode.com/

Threading

 * http://stackoverflow.com/questions/1133123/multi-threaded-opengl-programming-in-cocos2d-iphone

Forums

 * http://gamedev.stackexchange.com/questions/2911/2d-game-dev-and-java-other-possibilities-than-opengl

Bitmap Font Editor

 * http://slick.cokeandcode.com/
 * http://slick.cokeandcode.com/demos/hiero.jnlp
 * http://www.learn-cocos2d.com/knowledge-base/tutorial-bitmap-fonts-hiero/

Particle Systems

 * http://cocos2d-iphone.googlecode.com/svn-history/r1639/trunk/tests/ParticleTest.m
 * http://parallelsix.com/development/?p=6
 * http://mygenoma.googlecode.com/svn/trunk/Genoma/libs/cocos2d/CCParticleExamples.m

CCDirector
CC_DIRECTOR_INIT
 * Generally init'd in app delegate

[CCDirector sharedDirector]
 * Shared singleton

[[CCDirectory sharedDirector] winSize]
 * Can get the window size

Scene Nodes
+ (id)scene;
 * require a static constructor

Tutorials

 * http://perspx.com/archives/cocos2d-for-mac/
 * http://www.oscarvgg.com/your-first-game-in-cocos2d-part-3-the-gameplay/
 * http://www.cocos2d-iphone.org/forum/topic/4398