1

Im using Chipmunk with Cocos2d to make a gravity based puzzle game, however I have reached a part of my project whereby I need a sprite that once drawn does not move and cannot be moved by the other sprites within the environment.

In essence...

Can I create a static (non moving) sprite that is not affected by in game gravity or other objects in the game.

Thanks in advance I've only been doing this project a week....

Candyfloss
  • 3,848
  • 4
  • 31
  • 32

1 Answers1

1

Yes, this is possible.

1) Create a body with infinite mass and moment.

2) Do not add the body to the space.

3) Create the desired shape.

Use cpSpaceAddStaticShape to add the shape to the space.

HS.
  • 15,442
  • 8
  • 42
  • 48