Exemple #1
0
        //int frameIndex;
        //DateTime lastFrameBeginTime = DateTime.Now;
        public SceneMaker2D(Game metalx)
            : base(metalx)
        {
            drawGrid = false;
            drawPen = true;
            frameIndex = 0;
            drawCode = false;
            drawCodeLayer = 0;

            dragRect = new Rectangle();
            penRect = new Rectangle();

            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources.o), "smo");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources.x), "smx");

            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._0), "sm0");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._1), "sm1");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._2), "sm2");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._3), "sm3");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._4), "sm4");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._5), "sm5");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._6), "sm6");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._7), "sm7");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._8), "sm8");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources._9), "sm9");
            game.Textures.Add(game.LoadDotMXTexture(Properties.Resources.j), "j");
        }
Exemple #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     game = new Game();
     //ui_ip.Text = game.Options.ServerIP;
     ui_port.Text = game.Options.ServerPort.ToString();
     game.NetManager.OnDataReceived += new NetEvent(NetManager_OnDataReceived);
 }
Exemple #3
0
        public MetalHunter()
        {
            game = new Game("MetalHunter");

            game.InitData();
            game.InitCom();

            game.LoadAllDotPNG(new Size(16, 16));
            game.LoadAllDotMP3();

            game.LoadAllDotMXScene();
            game.LoadAllDotMXNPC();
            game.LoadAllDotMXScript();
            game.LoadAllDotMXMovie();
            game.LoadAllDotMXMonster();

            InitFormBoxes();
            InitItems();

            game.ScriptManager.AppendDotMetalXScript("logo");
            game.ScriptManager.Execute();

            game.FormBoxManager.OnKeyUp += new KeyboardEvent(FormBoxManager_OnKeyUp);
            game.SceneManager.OnKeyUp += new KeyboardEvent(SceneManager_OnKeyUp);

            game.Start();
        }
Exemple #4
0
 public LogoEngine(Game g)
     : base(g)
 {
     Name = "LogoEngine";
     Location = new Point();
     BGTextureBox.Texture.Name = "logo_engine";
     BGTextureBox.Size = new Size(640, 480);
 }
Exemple #5
0
 public GameCom(Game game)
 {
     this.game = game;
     OnKeyDown = new KeyboardEvent(OnKeyDownCode);
     OnKeyUp = new KeyboardEvent(OnKeyUpCode);
     OnKeyDownHold = new KeyboardEvent(OnKeyDownHoldCode);
     EnableAll();
 }
Exemple #6
0
        public LogoGame(Game g)
            : base(g)
        {
            Name = "LogoGame";
            Location = new Point(0, 400);
            //Size = new Size(640, 120);
            //BGTextureName = "bg-256x64";

            TextBox tb1 = new TextBox(g);
            tb1.Location = new Point(16, 16);
            tb1.Text = "MetalHunter!";
            tb1.FontName = "Consolas";
            tb1.FontSize = 36;
            tb1.Interval = 200;
            tb1.OneByOne = true;

            ControlBoxes.Add(tb1);
        }
Exemple #7
0
        public MenuBAG(Game g)
            : base(g)
        {
            //BigStep = 8;

            Name = "MenuBAG";
            Location = new Point(320, 0);

            BGTextureBox.Texture.Name = "bg_160x240";
            BGTextureBox.Size = new Size(320, 480);

            for (int i = 0; i < 16; i++)
            {
                bb.Add(new ButtonBox(game));
            }

            tb = new TextBox(g);
            //tb.OneByOne = true;
            //tb.Interval = 10;
            tb.Location = new Point(184, 24);

            this.OnFormBoxDisappear += new FormBoxEvent(MenuBAG_OnFormBoxDisappear);
            this.OnFormBoxAppear += new FormBoxEvent(MenuBAG_OnFormBoxAppear);
        }
Exemple #8
0
        void open_scene(string fileName, bool isxml)
        {
            left_rect = new Rectangle();
            right_rect = new Rectangle();
            if (game != null)
            {
                game.Stop();
            }
            game = new Game(pictureBox1);
            game.InitData();
            game.InitCom();
            game.LoadAllDotPNG(new Size(game.Options.TileSizePixel.Width / 2, game.Options.TileSizePixel.Height / 2));
            game.LoadAllDotMXNPC();

            sceneMaker2D = new SceneMaker2D(game);

            if (isxml)
            {
                game.SCN = game.LoadDotMXSceneDotXML(fileName);
            }
            else
            {
                game.SCN = game.LoadDotMXScene(fileName);
            }

            update_pic_list();
            update_mus_list();
            update_npc_list();
            update_info();
            update_layer_selecter();
            update_monster_zone_list();

            pictureBox1.Size = game.SCN.SizePixel;

            tabControl1.SelectedIndex = 1;
            game.GameComs.Clear();
            game.MountGameCom(sceneMaker2D);
            game.Start();
        }
Exemple #9
0
        void new_scene(Size size, Size tilesizepixel)
        {
            left_rect = new Rectangle();
            right_rect = new Rectangle();
            if (game != null)
            {
                game.Stop();
            }

            pictureBox1.Size = new Size(size.Width * tilesizepixel.Width, size.Height * tilesizepixel.Height);

            game = new Game(pictureBox1);
            game.InitCom();
            game.InitData();
            game.LoadAllDotPNG(new Size(tilesizepixel.Width / 2, tilesizepixel.Height / 2));
            game.LoadAllDotMXNPC();

            update_pic_list();
            update_mus_list();

            sceneMaker2D = new SceneMaker2D(game);

            int sw = size.Width;
            int sh = size.Height;
            int tw = tilesizepixel.Width;
            int th = tilesizepixel.Height;

            game.SCN = new Scene(new Size(sw, sh), new Size(tw, th));

            game.SCN.Name = ui_scenename.Text;
            game.SCN.FrameInterval = int.Parse(ui_framedelay.Text);

            create_layer_selecter();

            tabControl1.SelectedIndex = 1;
            game.GameComs.Clear();
            game.MountGameCom(sceneMaker2D);
            game.Start();
        }
Exemple #10
0
 public GameWindow(Game g)
 {
     Text = g.Name;
     StartPosition = FormStartPosition.CenterScreen;
     Size = g.Options.WindowSizePixel;
     FormBorderStyle = FormBorderStyle.None;
     MaximizeBox = false;
     MinimizeBox = false;
     SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque, true);
 }
Exemple #11
0
 //public MetalXTexture t;
 public ModelMaker(Game g)
     : base(g)
 {
 }
Exemple #12
0
        public MenuMonster(Game g)
            : base(g)
        {
            Name = "MenuMonster";

            movie = game.LoadDotMXMovie(game.MovieFiles["cursor"].FullName);
            OnFormBoxDisappear += new FormBoxEvent(MenuMonster_OnFormBoxDisappear);
            OnFormBoxAppear += new FormBoxEvent(MenuMonster_OnFormBoxAppear);

            ControlBoxes.Clear();
            for (int i = 0; i < 16; i++)
            {
                bb.Add(new ButtonBox(game));
                bb[i].OnButtonFocus += new ButtonBoxEvent(MenuMonster_OnButtonFocus);
                bb[i].OnButtonUp += new ButtonBoxEvent(MenuMonster_OnButtonUp);
                //ControlBoxes.Add(bb[i]);
            }
        }
Exemple #13
0
        public MenuLoad(Game g)
            : base(g)
        {
            Name = "MenuLoad";

            for (int i = 0; i < 3; i++)
            {
                bb.Add(new ButtonBox(g));
                bb[i].Location = new Point(64, 48 + 128 * i);
                bb[i].Size = new System.Drawing.Size(512, 128);
                bb[i].WaitTextureBox.Texture.Name = "bg_256x64";
                bb[i].FocusTextureBox.Texture.Name = "bg_256x64";
                bb[i].DownTextureBox.Texture.Name = "bg_256x64";
                bb[i].UpTextureBox.Texture.Name = "bg_256x64";
                bb[i].WaitTextureBox.Size = new System.Drawing.Size(512, 128);
                bb[i].FocusTextureBox.Size = new System.Drawing.Size(512, 128);
                bb[i].DownTextureBox.Size = new System.Drawing.Size(512, 128);
                bb[i].UpTextureBox.Size = new System.Drawing.Size(512, 128);

                bb[i].WaitTextBox.Text = "存档" + (i + 1).ToString();
                bb[i].WaitTextBox.Location = new Point(32, 32);
                bb[i].FocusTextBox.Text = "存档" + (i + 1).ToString();
                bb[i].FocusTextBox.Location = new Point(32, 32);
                bb[i].FocusTextBox.FontColor = Color.CornflowerBlue;
                bb[i].DownTextBox.Text = "存档" + (i + 1).ToString();
                bb[i].DownTextBox.Location = new Point(32, 32);
                bb[i].DownTextBox.FontColor = Color.Yellow;
                bb[i].UpTextBox.Text = "存档" + (i + 1).ToString();
                bb[i].UpTextBox.Location = new Point(32, 32);

                ControlBoxes.Add(bb[i]);
            }

            bb[0].OnButtonUp += new ButtonBoxEvent(MenuLoad_OnButtonUp0);
            bb[1].OnButtonUp += new ButtonBoxEvent(MenuLoad_OnButtonUp1);
            bb[2].OnButtonUp += new ButtonBoxEvent(MenuLoad_OnButtonUp2);
        }
Exemple #14
0
        public MenuCHRASK(Game g)
            : base(g)
        {
            Name = "MenuCHRASK";
            Location = new Point(576, 48);
            BGTextureBox.Texture.Name = "bg_64x64";
            BGTextureBox.Size = new System.Drawing.Size(128, 128);

            BB1 = new ButtonBox(g);
            BB1.Location = new Point(48, 24);
            BB1.UpTextBox.Text = BB1.DownTextBox.Text = BB1.FocusTextBox.Text = BB1.WaitTextBox.Text = "装备";
            BB1.FocusTextBox.FontColor = Color.CornflowerBlue;
            BB1.OnButtonUp += new ButtonBoxEvent(BB1_OnButtonUp);

            BB2 = new ButtonBox(g);
            BB2.Location = new Point(48, 24);
            BB2.UpTextBox.Text = BB2.DownTextBox.Text = BB2.FocusTextBox.Text = BB2.WaitTextBox.Text = "卸下";
            BB2.FocusTextBox.FontColor = Color.CornflowerBlue;
            BB2.OnButtonUp += new ButtonBoxEvent(BB2_OnButtonUp);

            //ControlBoxes.Add(BB1);
            ControlBoxes.Add(BB2);
        }
Exemple #15
0
        public MenuCHR(Game g)
            : base(g)
        {
            Name = "MenuCHR";
            Location = new Point(0, 0);

            BGTextureBox.Texture.Name = "bg_160x240";
            BGTextureBox.TextureFliterColor = Color.FromArgb(150, 0xff, 0xff, 0xff);
            BGTextureBox.Size = new Size(320, 480);

            int line = 5;

            head = new TextureBox(g);
            head.Location = new Point(32, 16);
            head.Size = new Size(96, 96);

            nam = new TextBox(g);
            nam.Location = new Point(24, line++ * 24 - 4);

            exp = new TextBox(g);
            exp.Location = new Point(24, line++ * 24 - 4);

            lv = new TextBox(g);
            lv.Location = new Point(24, line++ * 24);

            hp = new TextBox(g);
            hp.Location = new Point(24, line++ * 24);

            itl = new TextBox(g);
            itl.Location = new Point(24, line++ * 24);

            str = new TextBox(g);
            str.Location = new Point(24, line++ * 24);

            agi = new TextBox(g);
            agi.Location = new Point(24, line++ * 24);

            phy = new TextBox(g);
            phy.Location = new Point(24, line++ * 24);

            mtllv = new TextBox(g);
            mtllv.Location = new Point(24, line++ * 24 + 4);

            chrlv = new TextBox(g);
            chrlv.Location = new Point(24, line++ * 24 + 4);

            line = 0;

            dmg = new TextBox(g);
            dmg.Location = new Point(160, (++line) * 24);

            //b_weapon = new ButtonBox(g);
            //b_weapon.Location = new Point(224, line++ * 32);
            //b_weapon.OnButtonFocus += new ButtonBoxEvent(MenuCHR_OnButtonFocus);
            //b_weapon.OnButtonUp += new ButtonBoxEvent(MenuCHR_OnButtonUp);

            def = new TextBox(g);
            def.Location = new Point(160, (line+=2) * 24);

            ControlBoxes.Add(head);
            ControlBoxes.Add(nam);
            ControlBoxes.Add(lv);
            ControlBoxes.Add(hp);

            ControlBoxes.Add(dmg);
            ControlBoxes.Add(def);

            ControlBoxes.Add(str);
            ControlBoxes.Add(agi);
            ControlBoxes.Add(itl);
            ControlBoxes.Add(phy);

            ControlBoxes.Add(chrlv);
            ControlBoxes.Add(mtllv);

            ControlBoxes.Add(exp);

            //ControlBoxes.Add(b_weapon);
            line = 5;

            b_equip = new List<ButtonBox>();
            for (int i = 0; i < 8; i++)
            {
                b_equip.Add(new ButtonBox(g));
                b_equip[i].OnButtonFocus += new ButtonBoxEvent(MenuCHR_OnButtonFocus);
                b_equip[i].OnButtonUp += new ButtonBoxEvent(MenuCHR_OnButtonUp);
                b_equip[i].Location = new Point(144, line * 24 + i * 24);
                ControlBoxes.Add(b_equip[i]);
            }

            this.OnFormBoxAppear += new FormBoxEvent(MenuCHR_OnFormBoxAppear);
            this.OnFormBoxDisappear += new FormBoxEvent(MenuCHR_OnFormBoxDisappear);
        }
Exemple #16
0
 public Devices(Game g)
 {
     game = g;
     GameWindow = new MetalX.GameWindow(g);
     init();
 }
Exemple #17
0
        public MenuBattleCHR(Game g)
            : base(g)
        {
            Name = "MenuBattleCHR";
            Location = new Point(640 - 128, 480 - 128);
            BGTextureBox.Texture.Name = "bg_64x64";
            BGTextureBox.Size = new System.Drawing.Size(128, 128);

            BB1 = new ButtonBox(g);
            BB1.Location = new Point(20, 16);
            BB1.WaitTextBox.Text = "攻击";
            BB1.SameAsWait();
            BB1.OnButtonUp += new ButtonBoxEvent(BB1_OnButtonUp);

            BB2 = new ButtonBox(g);
            BB2.Location = new Point(20, 32);
            BB2.WaitTextBox.Text = "道具";
            BB2.SameAsWait();
            BB2.OnButtonUp += new ButtonBoxEvent(BB2_OnButtonUp);

            BB3 = new ButtonBox(g);
            BB3.Location = new Point(20, 48);
            BB3.WaitTextBox.Text = "装备";
            BB3.SameAsWait();
            BB3.OnButtonUp += new ButtonBoxEvent(BB3_OnButtonUp);

            BB4 = new ButtonBox(g);
            BB4.Location = new Point(20, 64);
            BB4.WaitTextBox.Text = "乘降";
            BB4.SameAsWait();
            BB4.OnButtonUp += new ButtonBoxEvent(BB4_OnButtonUp);

            BB5 = new ButtonBox(g);
            BB5.Location = new Point(20, 80);
            BB5.WaitTextBox.Text = "逃跑";
            BB5.SameAsWait();
            BB5.OnButtonUp += new ButtonBoxEvent(BB5_OnButtonUp);

            ControlBoxes.Add(BB1);
            ControlBoxes.Add(BB2);
            ControlBoxes.Add(BB3);
            ControlBoxes.Add(BB4);
            ControlBoxes.Add(BB5);
        }
Exemple #18
0
 public Devices(Game g, Control c)
 {
     game = g;
     GameControl = c;
     init();
 }
Exemple #19
0
        public MH_MSGBox(Game g)
            : base(g)
        {
            Location = new Point(64, 480 - 128 - 8);

            BGTextureBox.Texture.Name = "bg_256x64";
            BGTextureBox.Size = new Size(512, 128);

            TextBox.Location = new Point(20, 20);
            TextBox.OneByOne = true;

            TextBox.FontName = "微软雅黑";
            TextBox.FontSize = 15;
        }