• Entities (Entities\BaseEntity.cs)
    • Almost everything you will see in any given scene will be an Entity. The BaseEntity class is a generic class that allows similar access to all Entities in the game world. As an example, when you run the default example of the engine, you’re seeing a terrain, some cubes, and a sky, all of those types of things are entities. Also, the camera that the scene is rendering from is an entity as well.
    • Creating an Entity
      • To get an Entity into the game world you must only create an Entity, and add it to the game’s Scene Manager.
      • An example of creating an Entity can be seen in SampleScene.cs in the QuickStartSampleGame_Windows project. In the BoxStack() function you will see a line like this:
        BaseEntity newEntity = new BaseEntity(this.game, boxPos, Matrix.Identity, 9.0f);
      • What this does is creates a new Entity, tells it which game it is attached to, gives it a position, a rotation, and a scale.
      • If you want to manually add an entity to a scene, you can use this method.
        this.game.SceneManager.AddEntity(newEntity);
      • You can also create entities from the EntityDefinition XML file (which we'll go over soon). All the entities in the sample that comes with the game are loaded this way.
      • You now have a box in the game world. However, these two steps alone are not enough for you to see the Entity, because it doesn’t have a model from which to be rendered. You will find this step out soon.
  • EntityLoader (documentation pending)
  • Components

  • Creating Entities and Components with XML

 


 

BaseEntity functionality (documentation pending here)

  • Initialize()
  • Shutdown()
  • Update()
  • FixedUpdate()
  • ExecuteMessage()

Last edited Jan 11, 2012 at 5:55 PM by LordIkon, version 12

Comments

No comments yet.