⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 creator.cs

📁 《3d游戏编程入门经典》中范例小游戏。使用C#+DirectX开发。
💻 CS
📖 第 1 页 / 共 2 页
字号:
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.chkWrap = new System.Windows.Forms.CheckBox();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.txtTime = new System.Windows.Forms.TextBox();
            this.txtMoves = new System.Windows.Forms.TextBox();
            this.levelNumber = new System.Windows.Forms.NumericUpDown();
            this.label7 = new System.Windows.Forms.Label();
            this.btnSave = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.levelNumber)).BeginInit();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(64, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Color 1";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(80, 8);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(64, 23);
            this.label2.TabIndex = 1;
            this.label2.Text = "Color 2";
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(160, 8);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(64, 23);
            this.label3.TabIndex = 2;
            this.label3.Text = "Color 3";
            // 
            // label4
            // 
            this.label4.Location = new System.Drawing.Point(232, 8);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(64, 23);
            this.label4.TabIndex = 3;
            this.label4.Text = "Color 4";
            // 
            // chkWrap
            // 
            this.chkWrap.Location = new System.Drawing.Point(296, 40);
            this.chkWrap.Name = "chkWrap";
            this.chkWrap.Size = new System.Drawing.Size(120, 16);
            this.chkWrap.TabIndex = 4;
            this.chkWrap.Text = "Wrap Colors?";
            // 
            // label5
            // 
            this.label5.Location = new System.Drawing.Point(296, 72);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(104, 23);
            this.label5.TabIndex = 9;
            this.label5.Text = "Number Seconds";
            // 
            // label6
            // 
            this.label6.Location = new System.Drawing.Point(296, 136);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(104, 23);
            this.label6.TabIndex = 10;
            this.label6.Text = "Max Moves";
            // 
            // txtTime
            // 
            this.txtTime.Location = new System.Drawing.Point(296, 96);
            this.txtTime.Name = "txtTime";
            this.txtTime.Size = new System.Drawing.Size(96, 20);
            this.txtTime.TabIndex = 11;
            this.txtTime.Text = "180.0";
            // 
            // txtMoves
            // 
            this.txtMoves.Location = new System.Drawing.Point(296, 168);
            this.txtMoves.Name = "txtMoves";
            this.txtMoves.Size = new System.Drawing.Size(96, 20);
            this.txtMoves.TabIndex = 12;
            this.txtMoves.Text = "500";
            // 
            // levelNumber
            // 
            this.levelNumber.Location = new System.Drawing.Point(296, 232);
            this.levelNumber.Minimum = new System.Decimal(new int[] {
                                                                        1,
                                                                        0,
                                                                        0,
                                                                        0});
            this.levelNumber.Name = "levelNumber";
            this.levelNumber.Size = new System.Drawing.Size(104, 20);
            this.levelNumber.TabIndex = 13;
            this.levelNumber.Value = new System.Decimal(new int[] {
                                                                      1,
                                                                      0,
                                                                      0,
                                                                      0});
            // 
            // label7
            // 
            this.label7.Location = new System.Drawing.Point(296, 208);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(104, 23);
            this.label7.TabIndex = 14;
            this.label7.Text = "Level Number";
            // 
            // btnSave
            // 
            this.btnSave.Location = new System.Drawing.Point(304, 320);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new System.Drawing.Size(104, 24);
            this.btnSave.TabIndex = 15;
            this.btnSave.Text = "Save Level";
            this.btnSave.Click += new System.EventHandler(this.OnSaveLevel);
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(424, 382);
            this.Controls.Add(this.btnSave);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.levelNumber);
            this.Controls.Add(this.txtMoves);
            this.Controls.Add(this.txtTime);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.chkWrap);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Form1";
            this.Text = "Blockers Level Creator";
            ((System.ComponentModel.ISupportInitialize)(this.levelNumber)).EndInit();
            this.ResumeLayout(false);

        }
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}


        private void OnMainButtonClick(object sender, System.EventArgs e)
        {
            Button b = sender as Button;

            int index = (int)b.Tag;
            
            mainColors[index]++;
            if (mainColors[index] >= BoxColors.Length)
                mainColors[index] = 0;

            ((Button)sender).BackColor = BoxColors[mainColors[index]];

            UpdateBoxColors();
        }

        private void OnLevelButtonClick(object sender, EventArgs e)
        {
            Button b = sender as Button;

            int index = (int)b.Tag;

            if ((Form.MouseButtons & MouseButtons.Right) == MouseButtons.Right)
            {
                playerIndex = index;
            }

            levelIndices[index]++;
            if (levelIndices[index] >= 5)
                levelIndices[index] = 0;
            
            UpdateBoxColors();
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -