So I'm looking at Playstation Suite which has a 2D Game Engine high-level library which seems cool because it includes a particle system - and the samples seem fairly slick - which is a cousin of Cocos2d. I've never used Cocos2d, but looking at both of these libraries I'm leery. Maybe somebody can explain why Cocos2d is a good thing.
My main worry is with the Actions that help you tween your sprites. On the surface it seems really cool - "Hey, with one line of code I can make this thing move beautifully from point A to point B." But the FP fan in me is like, woah, that seems really stateful. Seems like you're taking one of my least favorite kinds of bugs, the curtain problem, and making it an idiom. I'm imagining the fairly complex logic that might be operating on my sprites and thinking that these fire-and-forget tweens are not a good way to try to describe it.
So maybe some of you have worked with Cocos2d and love the tweens and are like, "Nope, state issues have never been a problem, because..." Let me know.
(Another thing I'm not crazy about is the way it mixes game mechanical state with rendering state. It looks like you're expected to subclass your game objects from the rendering objects. I like to keep mechanics separate from rendering if I can, something I did with sixty second shooter and the Richard Garfield game that we never got funded - I like my games to have a sort of document-view model, partly to ease porting and partly because it's just pretty. But I know that's my own weird thing. And why do I want a scene graph for 2d?)
All that said, it still might be worth going this route for the free particle system. I don't *have* to use the tweens. Or can anybody recommend a free particle system?
I'm using Cocos2D for my game at the moment, and I'm really only using the tweens for moving/animating stuff in menus, or when I show scores appearing/disappearing. For the most part, I'm wrapping the cocos "game objects" as the Renderable component of my own game objects, and just hooking into the cocos "update" calls to run my own simulation.
So yeah, state issues have never been a problem because of where I use them, and what I use them for. The particle system is quite nice too :)
Posted by: Tatham | June 05, 2012 at 11:49 AM