Exemple #1
0
        public static void Initialize(Form Form)
        {
            Textures.Initialize();
            GameWindow = Form;

            //g = Graphics.FromImage(bb);
            //bbg = GameWindow.CreateGraphics();

            Scale(GameWindow);

            DataHandler.LoadCharType();

            //World = new Map("World", 20, 20);
            worldscreen = new WorldScreen();
            ScreenManager.AddScreen(worldscreen);
            MapHandler.LoadMap("1");

            SkillButtons.Add(Keys.Space, null);
            SkillButtons.Add(Keys.S, null);
            SkillButtons.Add(Keys.D, null);

            Player = new Character();

            //Test
            SkillButtons[Keys.Space]       = new sAttack();
            SkillButtons[Keys.Space].Owner = Player;

            //BGM.PlayBGM(Globals.GameDir + "\\Content\\BGM\\Departure.mp3");

            GameTime.Start();
            GameLoop();
        }
Exemple #2
0
        public static void StartGame(bool StartAsEditor = false)
        {
            if (StartAsEditor)
            {
                Player = new Character();
            }

            worldscreen = new WorldScreen();
            ScreenManager.AddScreen(worldscreen);
            if (!StartAsEditor)
            {
                ScreenManager.AddScreen(new SceneScreen(DataHandler.LoadScreneByName("StartScene")));
            }
            MapHandler.LoadMap("StartMap");
            Player.CurPos.X = 14;
            Player.CurPos.Y = 35;
            Player.OffSet   = new Point(0, 0);
            Game.SetScreenByPlayerPos();

            CharType.SetSkill(Player);

            ItemButtons.Add(Key.Z, new iRestoreHP(Player));
            ItemButtons.Add(Key.X, new iRestoreMP(Player));
            ItemButtons.First().Value.Count = 10;
            ItemButtons.Last().Value.Count = 5;

            Globals.InitializeFlags();
            Globals.Money = 50000;

            //BGM.PlayBGM(Globals.GameDir + "\\Content\\BGM\\Departure.mp3");
            InGame = true;
        }