<< Chapter < Page
  Xna game studio     Page 1 / 8
Chapter >> Page >
Learn to design, create, and use a simple Sprite class. Also learn to use a generic List object.

Revised: Mon May 09 13:00:37 CDT 2016

This page is part of a Book titled XNA Game Studio .

Table of Contents

Preface

This module is one in a collection of modules designed primarily for teaching GAME 1343 Game and Simulation Programming I at Austin Community College in Austin, TX. These modules are intended tosupplement and not to replace the textbook.

An earlier module titled Getting Started provided information on how to get started programming with Microsoft's XNA Game Studio.

Viewing tip

I recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.

Figures

  • Figure 1 . Seven Sprite objects.
  • Figure 2 . Twenty-four Sprite objects with a green one at the top.

Listings

  • Listing 1 . Beginning of the Sprite class.
  • Listing 2 . Two overloaded constructors.
  • Listing 3 . The SetImage method.
  • Listing 4 . The Draw method of the Sprite class.
  • Listing 5 . Beginning of the class named Game1.
  • Listing 6 . The modified constructor for the Game1 class.
  • Listing 7 . The overridden LoadContent method.
  • Listing 8 . Beginning of the overridden Update method.
  • Listing 9 . Instantiate new Sprite objects.
  • Listing 10 . Make all the existing sprites move.
  • Listing 11 . Load a green ball image in the topmost Sprite object.
  • Listing 12 . Maintain the frame counter.
  • Listing 13 . The overridden Game1.Draw method.
  • Listing 14 . Contents of the file named Sprite.cs
  • Listing 15 . Contents of the file named Game1.cs.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Xna game studio. OpenStax CNX. Feb 28, 2014 Download for free at https://legacy.cnx.org/content/col11634/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Xna game studio' conversation and receive update notifications?

Ask