Difference between revisions of "Game Programming Class4"

esse quam videri
Jump to: navigation, search
(New page: Came Components About components Application Overview Game Components are reusable and easy to add to a game Game Components * GameComponent Class * DrawGameComponent Class htt...)
 
Line 1: Line 1:
 
+
==Came Components==
Came Components
+
About components [http://msdn.microsoft.com/en-us/library/bb203873.aspx Application Overview]
About components Application Overview
 
  
 
Game Components are reusable and easy to add to a game Game Components
 
Game Components are reusable and easy to add to a game Game Components
  
    * GameComponent Class
+
* GameComponent Class
    * DrawGameComponent Class
+
* DrawGameComponent Class
  
 
http://blogs.msdn.com/xna/archive/2006/08/31/734204.aspx
 
http://blogs.msdn.com/xna/archive/2006/08/31/734204.aspx
Sprite class
+
 
 +
===Sprite class===
 +
 
 
IntroPacManComponent.zip
 
IntroPacManComponent.zip
Project that refactors the pacman class into two classes
+
 
 +
Project that reactors the pacman class into two classes
 
Sprite.cs
 
Sprite.cs
 
DrawableSprite.cs
 
DrawableSprite.cs
 
PacMan.cs
 
PacMan.cs
Console Class
+
 
Separate IntroGameLibrary Project to help Encapulate Reusable Code. IntroConsole.zip
+
===Console Class===
 +
Separate IntroGameLibrary Project to help Encapsulate Reusable Code. IntroConsole.zip
 
IntoGameLibrary.zip
 
IntoGameLibrary.zip
  
Line 22: Line 25:
 
To Add the Component to the Game we make an delclare in the game class Then we need to add the componnet to the Game Components Collection.
 
To Add the Component to the Game we make an delclare in the game class Then we need to add the componnet to the Game Components Collection.
  
           
+
       
            GameConsole gameConsole;
+
<csharp>   
 +
        GameConsole gameConsole;
  
 
         public Game1()
 
         public Game1()
Line 34: Line 38:
 
         }
 
         }
 
              
 
              
 +
</csharp>
  
 
IntroConsole/Game1.cs
 
IntroConsole/Game1.cs
Homework
+
 
 +
==Homework==
 
Something
 
Something

Revision as of 03:04, 9 February 2009

Came Components

About components Application Overview

Game Components are reusable and easy to add to a game Game Components

  • GameComponent Class
  • DrawGameComponent Class

http://blogs.msdn.com/xna/archive/2006/08/31/734204.aspx

Sprite class

IntroPacManComponent.zip

Project that reactors the pacman class into two classes Sprite.cs DrawableSprite.cs PacMan.cs

Console Class

Separate IntroGameLibrary Project to help Encapsulate Reusable Code. IntroConsole.zip IntoGameLibrary.zip

IntoGameLibrary/GameConsole.cs To Add the Component to the Game we make an delclare in the game class Then we need to add the componnet to the Game Components Collection.


<csharp>

       GameConsole gameConsole;
       public Game1()
       {
           graphics = new GraphicsDeviceManager(this);
           Content.RootDirectory = "Content";
           gameConsole = new GameConsole(this);
           this.Components.Add(gameConsole);
       }
           

</csharp>

IntroConsole/Game1.cs

Homework

Something