Although it is possible to reuse the cocos2d v0.8 animation code, v0.99 introduces a new way to deal with animations (and sprites in general).
v0.99 has a new class named CCSpriteFrameCache that, as the name suggests, it is the cache of all the sprite frames.
You can load sprites frames to the CCSpriteFrameCache with:
a CGRect: the rectangle of the texture (from 1 texture you can create many CCSpriteFrame objects, in fact it is the recommend way to avoid wasting unnecessary memory).
Example:
// Obtain the shared instance of the cache
CCSpriteFrameCache *cache =[CCSpriteFrameCache sharedSpriteFrameCache;
// load the frames[cache addSpriteFramesWithFile:@"frames.plist"];
// It loads the frame named "frame1.png".// IMPORTANT: It doesn't load the image "frame1.png". "frama1.png" is a just the name of the frame
CCSpriteFrame *frame =[cache spriteFrameByName:@"frame1.png"];
[sprite setDisplayFrame:frame];
This was just an introduction to CCSpriteFrameCache.
Box2d is rigid-body physics engine that can be used as a good complement of cocos2d. In fact, cocos2d comes with 3 Xcode templates, and one of them is a cocos2d + box2d template.
Also, cocos2d comes with 2 box2d examples:
An accelerometer + multitouch box2d sample: Great sample for box2d newbies
And the box2d testbed: targeting more advanced users
Recently, Ray Wenderlich also wrote an interesting article regarding how use box2d with cocos2d v0.99.0:
Many thanks to all the developers, contributors, beta testers, and the community in general. We are building a professional-grade library both in terms of technical features and support!
How stable is this release ?
Very stable. According to the tests and feedback from the testers, this release can be considered v0.99.0. But since v0.99.0 introduces so many changes, this will the last pre-v0.99.0 release.
If there are no show-stoppers bugs, then, this will be the real v0.99.0 version.
No small fixes will be introduced unless they are show-stopper bugs.
Small fixes and improvements will be fixed during the v0.99.x series.
How fast is this release ?
All the performance tests were run, and v0.99.0-final is, at least, as fast as v0.8.2. In some cases it is faster, perhaps 10%~20% faster.
I would appreciate if you could test this release in your game. Please, report any bug that you might find.
Thanks!
Let’s say that you want to create a 3d game, with nice menus and fonts. It’s possible to do that using SIO2 to render the 3D scene and cocos2d to render the HUD.
How ? Yarri, from Play-N-Give , posted a detailed post regarding how to mix cocos2d and SIO2:
Recent Comments