Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Cocos2d Game Development Essentials
  • Table Of Contents Toc
Cocos2d Game Development Essentials

Cocos2d Game Development Essentials - Second Edition

By : Ben Trengrove
4.5 (2)
close
close
Cocos2d Game Development Essentials

Cocos2d Game Development Essentials

4.5 (2)
By: Ben Trengrove

Overview of this book

If you are a game developer with experience in Objective-C and are interested in creating games for iOS or Android, this is the book for you. It will help you to quickly get started with Cocos2D and guide you through the process of creating a game, giving you the essential skills and knowledge you need to do so.
Table of Contents (8 chapters)
close
close

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.

    Adding joints
  3. Drag Physics Pivot Joint onto the scene and position it in the top-right corner of the catapult base.
  4. Next, move the catapult arm so that its anchor point sits exactly at the center of the pivot joint. You can also rotate the arm so that it is...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Cocos2d Game Development Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon