- Why use a c hash instead of NSDictionary
- If the answer to (1) is speed, then it would seem even faster to use an array of structs, unless search is expected to be common.
- Chaining and modifying CCActions is a chore. Timing functions should modify an action rather than wrap it. Why?
- Making sequences should be the default, now it is a special case. Why?
- One would expect that making a callback after the completion of an action should be simple to do, now it requires a special action that you have to chain together using a CCActionSequence.
For example, envision code that works like this:
CCAction *fadeOut = [CCActionFadeOut actionWithDuration:3.0];
fadeOut.timing = [CCTimingEaseIn easeInWithRate:3.0];
fadeOut.next = [CCActionRemove action];
Of course, we could have everything in the constructor:
CCAction *fadeOut = [CCActionFadeOut actionWithDuration:3.0
Although it's tempting to do everything with classes, it's possible that this isn't the best tool for the task. Imagine a c-based solution:
Or a slightly longer example, from this:
id moveAction = [CCMoveBy actionWithDuration:2
id rotateAction = [CCRotateBy actionWithDuration:2
id tintAction = [CCTintTo actionWithDuration:1
id myCallFunc = [CCCallFunc actionWithTarget:self
[mySprite runAction: [CCSequence actions: moveAction, rotateAction, tintAction, myCallFunc, nil]];
tintTo(1, 255, 0, 0);