public void Initialize(Engine engine) { this.engine = engine; this.CreatePlayer(); var r = new Random(); for (int i = 0; i < 100; i++) { var node = new SceneNode(); var box = new PhysicsObject( "Cube", new Vector3(r.Next(20) - 10, r.Next(500) + 200, r.Next(20) - 10), Quaternion.Identity, Vector3.One, typeof(BoxShape), false); node.AttachEntity(box); this.AttachSceneNodeToRoot(node); } this.sceneGraph.Initialize(this.engine); }
public MainMenuGameState(Engine engine) : base(engine) { }
/// <summary> /// Initializes the scene graph. /// </summary> /// <param name="engine">The engine.</param> public void Initialize(Engine engine) { this.engine = engine; foreach (var entity in this.root.Entities) { entity.LoadContent(this.engine); if (entity.GetType() == typeof(PhysicsObject)) { var physicsObject = (PhysicsObject)entity; physicsObject.AttachToWorld(this.world); } if (entity.GetType() == typeof(Player)) { var player = (Player)entity; player.AttachToWorld(this.world); } } }
/// <summary> /// Initializes a new instance of the <see cref="GameState" /> class. /// </summary> /// <param name="engine">The engine.</param> public GameState(Engine engine) { this.engine = engine; }
public PausedGameState(Engine engine) : base(engine) { }
public Camera(Engine engine) { this.engine = engine; }