Right now our Sprite class can only place an image at a specified location on screen. The SpriteBatch class, however, provides much more flexibility than that, so let’s take advantage of it with our Sprite class. The effects we are interested in are as follows: – Origin/Rotation: These two properties allow us to specify an [...]
In game development, a “sprite” is simply a 2D image place somewhere on the screen. They generally make up the majority of a 2D game, and in a 3D game they may be used for the targeting reticule, the heads up display, etc. We are going to create a simple Sprite class that will handle [...]
-
February 9th, 2010 by Sean
The “Set” accessor in the Component’s “Parent” property should be changed to the following to avoid a condition where a component’s would be “orphaned” (have its “parent” property set to null and not appear in any GameScreen’s list of components) when its parent is set to the same value. public GameScreen Parent { get { [...]
-
January 3rd, 2010 by Sean
This section will walk us through the creation of our 2D components: those that are drawn directly onto the screen as though it were a flat canvas. At the moment this will only include the Sprite class, which is responsible for drawing images at specific locations on screen, but later on we may add 2D [...]
-
January 2nd, 2010 by Sean
Now that we have built the core of the Engine, we can finally start building some real components by creating classes that inherit from the “Component” class. Start by adding a new folder to the engine’s project called “Components”. The following sections will create new classes that we can add to that folder.
-
January 2nd, 2010 by Sean
The Engine Constructor used in the XNA Game Engine Tutorial Series 2.0 so far is incorrect. It should actually be as follows: public Engine(GraphicsDeviceManager Graphics) { services = new ServiceContainer(); services.AddService(typeof(IGraphicsDeviceService), Graphics); services.AddService(typeof(IGraphicsDeviceManager), Graphics); this.graphicsDevice = Graphics.GraphicsDevice; content = new IEContentManager(Services); spriteBatch = new SpriteBatch(GraphicsDevice); this.graphicsDevice = GraphicsDevice; } In the future, the tutorials and [...]
-
December 29th, 2009 by Sean