In this recipe we are going to demonstrate the basic collision detection facilities provided by the Bounds2
class.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.GameEngine2D
. You also need an image file; I am reusing our earth sprite from earlier recipes. The complete source for this example can be found in Ch4_Example5
.
Open
AppMain.cs
and replace the existing code with the following code:using System; using System.Collections.Generic; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Environment; using Sce.PlayStation.Core.Graphics; using Sce.PlayStation.Core.Input; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; namespace Ch4_Example5 { public class AppMain{ public static void Main (string[] args){ Director.Initialize(); Scene scene = new Scene(); scene.Camera.SetViewFromViewport(); SpriteUV...