예제 #1
0
        /// <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);
        }
예제 #2
0
 public void AddToDrawList(IDrawableGameObject visibleObject)
 {
     drawList.Add(visibleObject);
 }
예제 #3
0
 public void RemoveChild(IDrawableGameObject child)
 {
     this.ChildrenObjects.Remove(child);
 }
예제 #4
0
 public void AddChild(IDrawableGameObject child)
 {
     child.Transform.Parent = this.Transform;
     this.ChildrenObjects.Add(child);
 }