In this recipe, we are going to demonstrate toggling a physics body between dynamic and kinematic. We are also going to illustrate the effect of the coefficient of restitution on the physics scene.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.HighLevel.GameEngine2D
and Sce.PlayStation.HighLevel.Physics2D
. I will again be using our earth.png
sprite; 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_Example2
.
Open
AppMain.cs
and edit it as follows:using System; usingSystem.Collections.Generic; usingSce.PlayStation.Core; usingSce.PlayStation.Core.Environment; 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_Example2...