In this recipe, we are going to cover two separate concepts at once. First, we are going to look at how to apply force to a rigid body. Then we are going to look at how to handle selecting objects within the physics scene by clicking/touching.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.HighLevel.GameEngine2D
and Sce.PlayStation.HighLevel.Physics2D
. Once again we will be making use of our small earth sprite, earthSmall.png
. The complete source and all images used can be found in Ch5_Example4
.
Open
AppMain.cs
and enter the following code: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_Example4 { public class AppMain { private static TextureInfo...