In this recipe, we are going to look at simulating a joint to create a pendulum style effect, swinging one physics body around another.
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
.
Open
AppMain.cs
and change the code to the following:using System; usingSce.PlayStation.Core; usingSce.PlayStation.Core.Graphics; usingSce.PlayStation.Core.Input; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; using Sce.PlayStation.HighLevel.Physics2D; namespace Ch5_Example3 { public class AppMain...