In this recipe, we are going to configure a simple physics scene consisting of a single rigid body (a sphere) and the effects of gravity on it.
Load up PlayStation Mobile Studio and create a new project. Add references to Sce.PlayStation.HighLevel.GameEngine2D
and Sce.PlayStation.HighLevel.Physics2D
. We also need to add a circular sprite; I used a picture of the earth aptly named earth.png
. The complete source and all images used can be found in Ch5_Example1
.
Add the earth sprite to your project, and set its Build Action to Content.
Open up the
AppMain.cs
file and replace the existing code with 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_Example1 { public class AppMain { private...