O'Reilly logo

Cocos2D Game Development Essentials by Ben Trengrove

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding joints

A joint does exactly what it sounds like it would do. It joins objects together. There are three types of joints:

  • Physics Pivot Joint: This connects two objects with a single point
  • Physics Distance Joint: This connects two objects together at a set distance
  • Physics Spring Joint: This connects two objects together at a set distance, but instead of the joint being rigidly set, it allows the distance to change in the manner of a spring
  1. The first step is to make the base of your catapult static. You don't want it to move throughout the scene.
  2. The joint you will be using is the first option: the physics pivot joint as you want your catapult arm to pivot around a point.

    All of the physics joints are available in the SpriteBuilder objects pane. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required