/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. this.spriteBatch = new SpriteBatch(this.GraphicsDevice); this.background = new BackgroundObject(this.Content, "bg1"); this.startMenu.LoadContent(this.Content); this.font = this.Content.Load <SpriteFont>("MyFont"); IDrawableGameObject barbarian = CharacterFactory.Create("Barbarian", this.Content, 100, 400); IDrawableGameObject goblin = MonsterFactory.Create("Goblin", this.Content, 500, 400); IDrawableGameObject blackDragon = MonsterFactory.Create("BlackDragon", this.Content, 1200, 450); this.player = (ICharacter)barbarian; this.gameObjects.Add(barbarian); this.gameObjects.Add(goblin); this.gameObjects.Add(blackDragon); }
public void AddToDrawList(IDrawableGameObject visibleObject) { drawList.Add(visibleObject); }
public void RemoveChild(IDrawableGameObject child) { this.ChildrenObjects.Remove(child); }
public void AddChild(IDrawableGameObject child) { child.Transform.Parent = this.Transform; this.ChildrenObjects.Add(child); }