In this recipe we are going
to demonstrate three different ways you can update a node derived object: handling the update directly in the game loop, inheriting from a node derived class, and overriding the Update
method or passing a delegate in to a Node's Schedule
property.
Load up PSM Studio and create a new project. Add a reference to Sce.PlayStation.GameEngine2D
. We also need a sample sprite to work with; I will again be using our trusty F18
sprite, but feel free to substitute any reasonably sized graphic of your own. The complete source for this example can be found in Ch4_Example1
.
Add the sprite to the project and set its Build Action to Content.
Open
AppMain.cs
and replace the existing code with the following code:using System; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Graphics; using Sce.PlayStation.HighLevel.GameEngine2D; using Sce.PlayStation.HighLevel.GameEngine2D.Base; namespace Ch4_Example1 { public...