In this recipe, we are going to create a game loop using the GameEngine2D
library. The game loop is essentially the heart of your game, where input is read, graphics are drawn, and the game is updated. The GameEngine2D
library helps you by making all of these aspects easier.
Load up PlayStation Mobile Studio and create a new project. Add a reference to Sce.PlayStation.GameEngine2D
. The complete source for this example can be found in Ch3_Example1
.
In the
AppMain.cs
enter the following code:using System; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; namespace Ch3_Example1 { public class AppMain { public static void Main(){ Director.Initialize(); Scene scene = new Scene(); scene.Camera.SetViewFromViewport(); var label = new Sce.PlayStation.HighLevel.GameEngine2D.Label(); label.Text = "Hello world"; scene.AddChild(label); Director...