Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public static void Initialize(Form Form)
        {
            Textures.Initialize();
            GameWindow    = Form;
            FrameInterval = (int)Math.Ceiling(1000.0 / Globals.MAX_FRAME_PER_SECOND);

            bb = new Bitmap(Globals.resWidth, Globals.resHeight);
            g  = Graphics.FromImage(bb);
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;

            Frame.Parent = GameWindow;
            Frame.Dock   = DockStyle.Fill;
            Frame.SendToBack();
            Frame.SizeMode    = PictureBoxSizeMode.StretchImage;
            Frame.MouseClick += Frame_MouseClick;

            BGM.BGMPlayer.settings.volume = Settings.MusicVolume;

            DataHandler.LoadCharType();

            ResetGame();

            ScreenManager.AddScreen(new TitleScreen());

            GameTime.Start();
            GameLoop();
        }