In this recipe, we are going to demonstrate how to check for a collision between rigid bodies.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.HighLevel.GameEngine2D
and Sce.PlayStation.HighLevel.Physics2D
. This time we will be using our full-sized earth sprite earth.png
. The complete source and all images used can be found in Ch5_Example5
.
Replace the existing code in
AppMain.cs
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_Example5 { public class AppMain { private static Texture2D _texture; private static TextureInfo _ti; privateconst float PtoM = 50.0f; public static void Main (string[] args) { Director.Initialize...