Creating a (physics!) joint

In this recipe, we are going to look at simulating a joint to create a pendulum style effect, swinging one physics body around another.

Getting ready

Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.HighLevel.GameEngine2D and Sce.PlayStation.HighLevel.Physics2D. We will be re-using our earth sprite from the earlier recipe, this time reduced in size by 50 percent and named, appropriately enough, earthSmall.png. Add this image or a similar one to your scene and set its Build Type to Content. The complete source and all images used can be found in Ch5_Example3.

How to do it...

  1. Open AppMain.cs and change the code to the following:
    using System; usingSce.PlayStation.Core; usingSce.PlayStation.Core.Graphics; ...

Get PlayStation®Mobile Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.