Beispiel #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            if (STARTPLAY)
            {
                state = GameState.RUNNING;
                playstate = PlayState.WORLD;
            }
            else
            {
                state = GameState.EDIT;
            }
            eventqueue = new Queue<Event>();
            quests = new Dictionary<String, Quest>();
            quests.Add(Quests.DRAGONQUEST.getQuestID(), Quests.DRAGONQUEST);
            playedendsound = false;
            texmap = new Dictionary<String, Texture2D>();
            maps = new Dictionary<String, TileMap>();
            lastmonstermove = 0;
            lastplayermove = 0;
            inaddevent = false;
            buttonFont = Content.Load<SpriteFont>("buttonFont");
            buttonImage = Content.Load<Texture2D>("Tiles/button");
            //PlayerBase war = p.getNewPlayer("WARRIOR");

            Player[] playerList = new Player[] { new Player(Player.WARRIOR, Sprite.WARRIOR, "Baethor", 10) };
            party = new Party(playerList);
            base.Initialize();
        }
 public BattleSequence(Party party, Enemy[] enemies, SpriteFont displayTextFont, TileMap battleMap, int xRet, int yRet, String retMap)
 {
     this.playerec = new BattleEntity[] { new BattleEntity(new Rectangle(366, 207, 32, 32), Game1.playerLeftFace, Game1.playerLeftFaceHit) };
     this.enemyrec = new BattleEntity[] { new BattleEntity(new Rectangle(111, 207, 32, 32), Game1.enemy1RightFace, Game1.enemy1RightFaceHit) };
     this.party = party;
     this.enemies = enemies;
     this.combatLog = new List<String>();
     this.combatLogFont = displayTextFont;
     this.currentActions = new Queue<BattleAction>();
     this.continueCombat = true;
     this.partyDead = false;
     this.enemiesDead= false;
     this.isWaiting = false;
     this.xRet = Convert.ToString(xRet);
     this.yRet = Convert.ToString(yRet);
     this.retMap = retMap;
     this.projectiles = new Queue<Projectile>();
     state = BattleStageType.ACTION;
     drawplayerhpattime = Int32.MaxValue;
 }