Adding a sprite to a scene

In this recipe, we are going to create a sprite and add it to a scene, rendering it centered on the screen .

Getting ready

Create a new project and add a reference to GameEngine2D. You are going to need to add an image file to use as a sprite; I will be reusing our trusty F18 graphic. The complete source for this example can be found in Ch3_Example3.

How to do it...

  1. Open AppMain.cs and add 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 Ch3_Example3 { public class ...

Get PlayStation®Mobile Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.