0
\$\begingroup\$

I am new to Cocos2D and I've realized that most of the codes written before the Cocos2d update used CCSprites. Recently I realized a lot of more recent codes after the update are using PhysicsSprite. What is the difference? What advantages does one have over the other, if any?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

PhysicsSprite is a CCSprite which uses a physics body to control the sprite's motion (position) and rotation.

Depending on whether you start with the Box2D or Chipmunk template, PhysicsSprite will either have a b2Body (Box2D) or a cpBody/cpShape (Chipmunk) as instance variables.

If you're not planning to use physics, use CCSprite. If you do, use PhysicsSprite for those sprites which represent physics objects.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .