Tutorials:Save Classes for Entities

Introduction The “Save” pattern provides a very powerful solution to saving information from your game. This article will expand on the Save pattern by discussing how you might create a Save class for an Entity in your game. What do you want to save? A Save class can save a variety of information – and[…]

Glue:Tutorials:Save Classes and Glue

Introduction The tutorial on proper information access discusses how to share information between different Screens and Entities in your game as well as how to have information persist after a Screen is destroyed. The tutorial suggested using “Save” classes to contain information. This pattern as it is used in the FlatRedBall Engine is discussed here.[…]

FlatRedBall.Content.Polygon.PolygonSave

Introduction The PolygonSave class is a “save” object which corresponds to the FlatRedBall.Math.Geometry.Polygon runtime object. For more information on the save pattern, see this page Creating a PolygonSave The following code shows how to create a PolygonSave from a Polygon: // Assuming polygonInstance is a valid Polygon PolygonSave polygonSave = PolygonSave.FromPolygon(polygonInstance); Creating a Polygon from[…]

FlatRedBall.Content.Scene.SpriteSave

Introduction The SpriteSave class is the “save” class for the Sprite object. The SpriteSave class is usually associated with the SpriteEditorScene class (SpriteEditorScene contains a list of SpriteSaves). The SpriteSave class is a useful class if you plan on manually loading or saving .scnx files. Code Example The SpriteSave is a “save” class which means[…]

FlatRedBall.Content.Math.Geometry.ShapeCollectionSave

Introduction The ShapeCollectionSave class is a “save” class. Save classes are classes which allow you to load XML files to runtime objects as well as to save data contained in runtime objects to XML files. For more information on Save files, check this article. You do not need to use the ShapeCollectionSave class in most[…]

Glue:Tutorials:Proper Information Access

Introduction The patterns and code created by Glue encourage proper information encapsulation. For example, Entities do not by default have access to the Screens that created them. Objects inside entities are by default private. Also, since the ScreenManager.CurrentScreen is casted as a Screen, you do not immediately know the current Screen’s type. This limit to[…]

XmlSerialize

Introduction The XmlSerialize and XmlDeserialize methods are methods which can be used to easily convert a class to an XML file, or an XML file back into an instance of a given type. XmlSerialize and XmlDeserialize are often used to save and load game data, such as player progress. Internally the FileManager uses the System.Xml.Serialization.XmlSerializer[…]

FlatRedBall.Content.AnimationChain.AnimationChainListSave

Introduction AnimationChainListSaves are the “save” object type for AnimationChainLists. AnimatiohChainListSaves can be used to create and load .achx files. For general information on common FlatRedBall types, see the FlatRedBall File Types wiki entry. The AnimationChainListSave class is a standardized way to save an AnimationChainList. Using the AnimationChainListSave class has the following benefits: Requires very little[…]