From 163efab3cfe44e96bfba58c3cb1e8c30b528c40c Mon Sep 17 00:00:00 2001 From: Mikhail Abramov Date: Sat, 21 Apr 2018 14:32:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B2=D0=B8=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D1=8F=D0=BC=D0=BE=20(RQKL)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit И выделение его в новый файл (это сам) --- .../WindowsFormsApplication1/Circle.cs | 6 +- .../WindowsFormsApplication1/Files.cs | 8 +- .../WindowsFormsApplication1/Line.cs | 46 +++++ .../MainForm.Designer.cs | 168 +++++++++++------- .../WindowsFormsApplication1/MainForm.cs | 36 +--- .../WindowsFormsApplication1/Sinus.cs | 10 +- .../WindowsFormsApplication1.csproj | 1 + 7 files changed, 166 insertions(+), 109 deletions(-) create mode 100644 WindowsFormsApplication1/WindowsFormsApplication1/Line.cs diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs index 0560954..c6afb73 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Circle.cs @@ -11,8 +11,8 @@ namespace WindowsFormsApplication1 { public static void CreatePerson(string filename, string name, Person p) { - File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); + File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\");" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine); @@ -34,7 +34,7 @@ namespace WindowsFormsApplication1 p.width + "/" + p.sprite + ", " + p.height + "," + name + ".texture, " + - p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 0, RGB(0, 255, 255));" + Environment.NewLine); + p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 255, RGB(0, 255, 255));" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); @@ -42,7 +42,7 @@ namespace WindowsFormsApplication1 File.AppendAllText(filename, " {" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine); File.AppendAllText(filename, " }" + Environment.NewLine); - File.AppendAllText(filename, " }" + Environment.NewLine) + File.AppendAllText(filename, " }" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); } } diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs index 03dbf6c..d832051 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Files.cs @@ -52,8 +52,8 @@ namespace WindowsFormsApplication1 public static void CloseWhile(string filename) { File.AppendAllText(filename, Environment.NewLine); - File.AppendAllText(filename, " myTime += 0.01;" + Environment.NewLine); - File.AppendAllText(filename, " txSleep(10);" + Environment.NewLine); + File.AppendAllText(filename, " myTime += 0.05;" + Environment.NewLine); + File.AppendAllText(filename, " txSleep(50);" + Environment.NewLine); File.AppendAllText(filename, " }" + Environment.NewLine); } @@ -69,8 +69,8 @@ namespace WindowsFormsApplication1 public static void Ending(string filename) { - File.AppendAllText(filename, " txDeleteDC(texture);" + Environment.NewLine); - File.AppendAllText(filename, " return 0;" + Environment.NewLine); + File.AppendAllText(filename, " txDeleteDC(texture);" + Environment.NewLine); + File.AppendAllText(filename, " return 0;" + Environment.NewLine); File.AppendAllText(filename, "}" + Environment.NewLine); } } diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs new file mode 100644 index 0000000..dfbb2d8 --- /dev/null +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Line.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WindowsFormsApplication1 +{ + public class Line + { + public static void CreatePerson(string filename, string name, Person p) + { + File.AppendAllText(filename, Environment.NewLine); + File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".nomer_kadra = 0; " + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine); + File.AppendAllText(filename, Environment.NewLine); + } + + public static void MovePerson(string filename, string name, Person p) + { + File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine); + File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, " + + p.width + "/" + p.sprite + ", " + + p.height + "," + + name + ".texture, " + + p.width + "/" + p.sprite + " * " + name + ".nomer_kadra, 255, RGB(255, 255, 255));" + Environment.NewLine); + File.AppendAllText(filename, Environment.NewLine); + File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine); + File.AppendAllText(filename, Environment.NewLine); + File.AppendAllText(filename, " if (" + name + ".nomer_kadra >= " + p.sprite + ")" + Environment.NewLine); + File.AppendAllText(filename, " {" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine); + File.AppendAllText(filename, " }" + Environment.NewLine); + File.AppendAllText(filename, " }" + Environment.NewLine); + File.AppendAllText(filename, Environment.NewLine); + } + } +} diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs index 34ba7cd..839e288 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs @@ -74,35 +74,39 @@ namespace WindowsFormsApplication1 // this.LabelData.AutoSize = true; this.LabelData.Font = new System.Drawing.Font("Arial Black", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.LabelData.Location = new System.Drawing.Point(0, 9); + this.LabelData.Location = new System.Drawing.Point(0, 11); + this.LabelData.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelData.Name = "LabelData"; - this.LabelData.Size = new System.Drawing.Size(224, 23); + this.LabelData.Size = new System.Drawing.Size(278, 28); this.LabelData.TabIndex = 0; this.LabelData.Text = "Данные о мултфильме:"; // // LabelLengh // this.LabelLengh.AutoSize = true; - this.LabelLengh.Location = new System.Drawing.Point(14, 60); + this.LabelLengh.Location = new System.Drawing.Point(19, 74); + this.LabelLengh.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelLengh.Name = "LabelLengh"; - this.LabelLengh.Size = new System.Drawing.Size(136, 13); + this.LabelLengh.Size = new System.Drawing.Size(175, 17); this.LabelLengh.TabIndex = 1; this.LabelLengh.Text = "Длительность: 35 секунд"; // // LabelName // this.LabelName.AutoSize = true; - this.LabelName.Location = new System.Drawing.Point(14, 86); + this.LabelName.Location = new System.Drawing.Point(19, 106); + this.LabelName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelName.Name = "LabelName"; - this.LabelName.Size = new System.Drawing.Size(60, 13); + this.LabelName.Size = new System.Drawing.Size(76, 17); this.LabelName.TabIndex = 2; this.LabelName.Text = "Название:"; // // nazvanieTextBox // - this.nazvanieTextBox.Location = new System.Drawing.Point(80, 86); + this.nazvanieTextBox.Location = new System.Drawing.Point(107, 106); + this.nazvanieTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.nazvanieTextBox.Name = "nazvanieTextBox"; - this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20); + this.nazvanieTextBox.Size = new System.Drawing.Size(183, 22); this.nazvanieTextBox.TabIndex = 3; // // panel1 @@ -118,34 +122,38 @@ namespace WindowsFormsApplication1 this.panel1.Controls.Add(this.LabelName); this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(297, 380); + this.panel1.Size = new System.Drawing.Size(396, 468); this.panel1.TabIndex = 4; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(14, 274); + this.label1.Location = new System.Drawing.Point(19, 337); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(259, 13); + this.label1.Size = new System.Drawing.Size(344, 17); this.label1.TabIndex = 24; this.label1.Text = "number name state view delete"; // // label13 // this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(44, 232); + this.label13.Location = new System.Drawing.Point(59, 286); + this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(180, 13); + this.label13.Size = new System.Drawing.Size(229, 17); this.label13.TabIndex = 23; this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ"; this.label13.Click += new System.EventHandler(this.label13_Click); // // PictureBoxBackground // - this.PictureBoxBackground.Location = new System.Drawing.Point(16, 158); + this.PictureBoxBackground.Location = new System.Drawing.Point(21, 194); + this.PictureBoxBackground.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.PictureBoxBackground.Name = "PictureBoxBackground"; - this.PictureBoxBackground.Size = new System.Drawing.Size(117, 72); + this.PictureBoxBackground.Size = new System.Drawing.Size(156, 89); this.PictureBoxBackground.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.PictureBoxBackground.TabIndex = 12; this.PictureBoxBackground.TabStop = false; @@ -153,17 +161,19 @@ namespace WindowsFormsApplication1 // LabelBackground // this.LabelBackground.AutoSize = true; - this.LabelBackground.Location = new System.Drawing.Point(14, 114); + this.LabelBackground.Location = new System.Drawing.Point(19, 140); + this.LabelBackground.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelBackground.Name = "LabelBackground"; - this.LabelBackground.Size = new System.Drawing.Size(77, 13); + this.LabelBackground.Size = new System.Drawing.Size(100, 17); this.LabelBackground.TabIndex = 11; this.LabelBackground.Text = "Выбрать фон:"; // // dobavitFonButton // - this.dobavitFonButton.Location = new System.Drawing.Point(17, 130); + this.dobavitFonButton.Location = new System.Drawing.Point(23, 160); + this.dobavitFonButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.dobavitFonButton.Name = "dobavitFonButton"; - this.dobavitFonButton.Size = new System.Drawing.Size(116, 24); + this.dobavitFonButton.Size = new System.Drawing.Size(155, 30); this.dobavitFonButton.TabIndex = 10; this.dobavitFonButton.Text = "Добавить"; this.dobavitFonButton.UseVisualStyleBackColor = true; @@ -171,9 +181,10 @@ namespace WindowsFormsApplication1 // // splitter1 // - this.splitter1.Location = new System.Drawing.Point(297, 0); + this.splitter1.Location = new System.Drawing.Point(396, 0); + this.splitter1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.splitter1.Name = "splitter1"; - this.splitter1.Size = new System.Drawing.Size(3, 380); + this.splitter1.Size = new System.Drawing.Size(4, 468); this.splitter1.TabIndex = 5; this.splitter1.TabStop = false; // @@ -184,17 +195,19 @@ namespace WindowsFormsApplication1 this.panel2.Controls.Add(this.SaveMultButton); this.panel2.Controls.Add(this.ButtonAddChar); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(300, 0); + this.panel2.Location = new System.Drawing.Point(400, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(377, 380); + this.panel2.Size = new System.Drawing.Size(503, 468); this.panel2.TabIndex = 6; // // SaveCharButton // this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom; - this.SaveCharButton.Location = new System.Drawing.Point(0, 320); + this.SaveCharButton.Location = new System.Drawing.Point(0, 394); + this.SaveCharButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.SaveCharButton.Name = "SaveCharButton"; - this.SaveCharButton.Size = new System.Drawing.Size(377, 30); + this.SaveCharButton.Size = new System.Drawing.Size(503, 37); this.SaveCharButton.TabIndex = 3; this.SaveCharButton.Text = "Сохранить персонажа"; this.SaveCharButton.UseVisualStyleBackColor = true; @@ -220,33 +233,37 @@ namespace WindowsFormsApplication1 this.panel3.Controls.Add(this.ComboBoxMove); this.panel3.Controls.Add(this.LabelMoveType); this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel3.Location = new System.Drawing.Point(0, 26); + this.panel3.Location = new System.Drawing.Point(0, 32); + this.panel3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(377, 324); + this.panel3.Size = new System.Drawing.Size(503, 399); this.panel3.TabIndex = 2; this.panel3.Visible = false; // // charNameBox // - this.charNameBox.Location = new System.Drawing.Point(85, 115); + this.charNameBox.Location = new System.Drawing.Point(113, 142); + this.charNameBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.charNameBox.Name = "charNameBox"; - this.charNameBox.Size = new System.Drawing.Size(138, 20); + this.charNameBox.Size = new System.Drawing.Size(183, 22); this.charNameBox.TabIndex = 19; // // charNameLabel // this.charNameLabel.AutoSize = true; - this.charNameLabel.Location = new System.Drawing.Point(19, 115); + this.charNameLabel.Location = new System.Drawing.Point(25, 142); + this.charNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.charNameLabel.Name = "charNameLabel"; - this.charNameLabel.Size = new System.Drawing.Size(60, 13); + this.charNameLabel.Size = new System.Drawing.Size(76, 17); this.charNameLabel.TabIndex = 18; this.charNameLabel.Text = "Название:"; // // openSpace // - this.openSpace.Location = new System.Drawing.Point(188, 189); + this.openSpace.Location = new System.Drawing.Point(251, 233); + this.openSpace.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.openSpace.Name = "openSpace"; - this.openSpace.Size = new System.Drawing.Size(186, 72); + this.openSpace.Size = new System.Drawing.Size(248, 89); this.openSpace.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.openSpace.TabIndex = 17; this.openSpace.TabStop = false; @@ -254,24 +271,27 @@ namespace WindowsFormsApplication1 // SpriteNumberLabel // this.SpriteNumberLabel.AutoSize = true; - this.SpriteNumberLabel.Location = new System.Drawing.Point(7, 153); + this.SpriteNumberLabel.Location = new System.Drawing.Point(9, 188); + this.SpriteNumberLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.SpriteNumberLabel.Name = "SpriteNumberLabel"; - this.SpriteNumberLabel.Size = new System.Drawing.Size(119, 13); + this.SpriteNumberLabel.Size = new System.Drawing.Size(155, 17); this.SpriteNumberLabel.TabIndex = 16; this.SpriteNumberLabel.Text = "Количество спрайтов:"; // // SpriteNumberTextBox // - this.SpriteNumberTextBox.Location = new System.Drawing.Point(10, 169); + this.SpriteNumberTextBox.Location = new System.Drawing.Point(13, 208); + this.SpriteNumberTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.SpriteNumberTextBox.Name = "SpriteNumberTextBox"; - this.SpriteNumberTextBox.Size = new System.Drawing.Size(83, 20); + this.SpriteNumberTextBox.Size = new System.Drawing.Size(109, 22); this.SpriteNumberTextBox.TabIndex = 15; // // OpenButton // - this.OpenButton.Location = new System.Drawing.Point(188, 153); + this.OpenButton.Location = new System.Drawing.Point(251, 188); + this.OpenButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.OpenButton.Name = "OpenButton"; - this.OpenButton.Size = new System.Drawing.Size(192, 30); + this.OpenButton.Size = new System.Drawing.Size(256, 37); this.OpenButton.TabIndex = 14; this.OpenButton.Text = "Открыть персонажа"; this.OpenButton.UseVisualStyleBackColor = true; @@ -280,75 +300,84 @@ namespace WindowsFormsApplication1 // LabelPic // this.LabelPic.AutoSize = true; - this.LabelPic.Location = new System.Drawing.Point(129, 153); + this.LabelPic.Location = new System.Drawing.Point(172, 188); + this.LabelPic.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelPic.Name = "LabelPic"; - this.LabelPic.Size = new System.Drawing.Size(58, 13); + this.LabelPic.Size = new System.Drawing.Size(75, 17); this.LabelPic.TabIndex = 12; this.LabelPic.Text = "Картинка:"; // // LabelTime // this.LabelTime.AutoSize = true; - this.LabelTime.Location = new System.Drawing.Point(19, 91); + this.LabelTime.Location = new System.Drawing.Point(25, 112); + this.LabelTime.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelTime.Name = "LabelTime"; - this.LabelTime.Size = new System.Drawing.Size(54, 13); + this.LabelTime.Size = new System.Drawing.Size(67, 17); this.LabelTime.TabIndex = 11; this.LabelTime.Text = "Тайминг:"; // // LabelDef2 // this.LabelDef2.AutoSize = true; - this.LabelDef2.Location = new System.Drawing.Point(240, 91); + this.LabelDef2.Location = new System.Drawing.Point(320, 112); + this.LabelDef2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelDef2.Name = "LabelDef2"; - this.LabelDef2.Size = new System.Drawing.Size(13, 13); + this.LabelDef2.Size = new System.Drawing.Size(18, 17); this.LabelDef2.TabIndex = 10; this.LabelDef2.Text = "--"; // // LabelDef1 // this.LabelDef1.AutoSize = true; - this.LabelDef1.Location = new System.Drawing.Point(240, 62); + this.LabelDef1.Location = new System.Drawing.Point(320, 76); + this.LabelDef1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelDef1.Name = "LabelDef1"; - this.LabelDef1.Size = new System.Drawing.Size(13, 13); + this.LabelDef1.Size = new System.Drawing.Size(18, 17); this.LabelDef1.TabIndex = 9; this.LabelDef1.Text = "--"; // // LabelWalls // this.LabelWalls.AutoSize = true; - this.LabelWalls.Location = new System.Drawing.Point(19, 62); + this.LabelWalls.Location = new System.Drawing.Point(25, 76); + this.LabelWalls.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelWalls.Name = "LabelWalls"; - this.LabelWalls.Size = new System.Drawing.Size(107, 13); + this.LabelWalls.Size = new System.Drawing.Size(138, 17); this.LabelWalls.TabIndex = 8; this.LabelWalls.Text = "Границы движения:"; // // TextBoxTime1 // - this.TextBoxTime1.Location = new System.Drawing.Point(132, 88); + this.TextBoxTime1.Location = new System.Drawing.Point(176, 108); + this.TextBoxTime1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.TextBoxTime1.Name = "TextBoxTime1"; - this.TextBoxTime1.Size = new System.Drawing.Size(100, 20); + this.TextBoxTime1.Size = new System.Drawing.Size(132, 22); this.TextBoxTime1.TabIndex = 5; // // TextBoxTime2 // - this.TextBoxTime2.Location = new System.Drawing.Point(259, 88); + this.TextBoxTime2.Location = new System.Drawing.Point(345, 108); + this.TextBoxTime2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.TextBoxTime2.Name = "TextBoxTime2"; - this.TextBoxTime2.Size = new System.Drawing.Size(100, 20); + this.TextBoxTime2.Size = new System.Drawing.Size(132, 22); this.TextBoxTime2.TabIndex = 4; // // TextBoxWall2 // - this.TextBoxWall2.Location = new System.Drawing.Point(259, 59); + this.TextBoxWall2.Location = new System.Drawing.Point(345, 73); + this.TextBoxWall2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.TextBoxWall2.Name = "TextBoxWall2"; - this.TextBoxWall2.Size = new System.Drawing.Size(100, 20); + this.TextBoxWall2.Size = new System.Drawing.Size(132, 22); this.TextBoxWall2.TabIndex = 3; this.TextBoxWall2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress); // // TextBoxWall1 // - this.TextBoxWall1.Location = new System.Drawing.Point(132, 59); + this.TextBoxWall1.Location = new System.Drawing.Point(176, 73); + this.TextBoxWall1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.TextBoxWall1.Name = "TextBoxWall1"; - this.TextBoxWall1.Size = new System.Drawing.Size(100, 20); + this.TextBoxWall1.Size = new System.Drawing.Size(132, 22); this.TextBoxWall1.TabIndex = 2; this.TextBoxWall1.TextChanged += new System.EventHandler(this.TextBoxWall1_TextChanged); this.TextBoxWall1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress); @@ -358,30 +387,33 @@ namespace WindowsFormsApplication1 this.ComboBoxMove.FormattingEnabled = true; this.ComboBoxMove.Items.AddRange(new object[] { "Прямо", - "По диагонали", + "Диагонально", "Волнами", "Кругами"}); - this.ComboBoxMove.Location = new System.Drawing.Point(107, 12); + this.ComboBoxMove.Location = new System.Drawing.Point(143, 15); + this.ComboBoxMove.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.ComboBoxMove.Name = "ComboBoxMove"; - this.ComboBoxMove.Size = new System.Drawing.Size(121, 21); + this.ComboBoxMove.Size = new System.Drawing.Size(160, 24); this.ComboBoxMove.TabIndex = 1; this.ComboBoxMove.Text = "Прямо"; // // LabelMoveType // this.LabelMoveType.AutoSize = true; - this.LabelMoveType.Location = new System.Drawing.Point(19, 12); + this.LabelMoveType.Location = new System.Drawing.Point(25, 15); + this.LabelMoveType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LabelMoveType.Name = "LabelMoveType"; - this.LabelMoveType.Size = new System.Drawing.Size(82, 13); + this.LabelMoveType.Size = new System.Drawing.Size(105, 17); this.LabelMoveType.TabIndex = 0; this.LabelMoveType.Text = "Вид движения:"; // // SaveMultButton // this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom; - this.SaveMultButton.Location = new System.Drawing.Point(0, 350); + this.SaveMultButton.Location = new System.Drawing.Point(0, 431); + this.SaveMultButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.SaveMultButton.Name = "SaveMultButton"; - this.SaveMultButton.Size = new System.Drawing.Size(377, 30); + this.SaveMultButton.Size = new System.Drawing.Size(503, 37); this.SaveMultButton.TabIndex = 1; this.SaveMultButton.Text = "Сохранить мульт"; this.SaveMultButton.UseVisualStyleBackColor = true; @@ -391,8 +423,9 @@ namespace WindowsFormsApplication1 // this.ButtonAddChar.Dock = System.Windows.Forms.DockStyle.Top; this.ButtonAddChar.Location = new System.Drawing.Point(0, 0); + this.ButtonAddChar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.ButtonAddChar.Name = "ButtonAddChar"; - this.ButtonAddChar.Size = new System.Drawing.Size(377, 26); + this.ButtonAddChar.Size = new System.Drawing.Size(503, 32); this.ButtonAddChar.TabIndex = 0; this.ButtonAddChar.Text = "Добавить персонажа"; this.ButtonAddChar.UseVisualStyleBackColor = true; @@ -404,12 +437,13 @@ namespace WindowsFormsApplication1 // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(677, 380); + this.ClientSize = new System.Drawing.Size(903, 468); this.Controls.Add(this.panel2); this.Controls.Add(this.splitter1); this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "MainForm"; this.RightToLeftLayout = true; this.Text = "Свойства персонажа"; diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs index f76cbde..fbff257 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs @@ -168,34 +168,6 @@ namespace WindowsFormsApplication1 } } - private void old_place(string filename, string name, Person p) - { - //ctrl-c ctrl-v texture n_sprites x2 y2 - File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); - File.AppendAllText(filename, Environment.NewLine); - File.AppendAllText(filename, " " + name + ".x = " + p.x1 + "; " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".y = " + p.y1 + "; " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".x2 = " + p.x2 + "; " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".y2 = " + p.y2 + "; " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".nomer_kadra = 0; " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine); - } - - private void go_pryamo(string filename, string name, Person p) - { - File.AppendAllText(filename, " if ((myTime >= " + p.time1 + ") && (myTime <= " + p.time2 + ")) {" + Environment.NewLine); - File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, 55, 86, " + name + ".texture, 55 * " + name + ".nomer_kadra, 0, RGB(0, 255, 255)); " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".x+= (" + name + ".x2 - " + name + ".x) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".y+= (" + name + ".y2 - " + name + ".y) / (" + p.time2 + "-" + p.time1 + ");" + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine); - File.AppendAllText(filename, " if (" + name + ".nomer_kadra > " + TextBoxWall1.Text + ") " + Environment.NewLine); - File.AppendAllText(filename, " { " + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine); - File.AppendAllText(filename, " }" + Environment.NewLine); - File.AppendAllText(filename, Environment.NewLine); - File.AppendAllText(filename, " }" + Environment.NewLine); - } - private void OpenAddCharClick(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.Cancel) @@ -292,7 +264,7 @@ namespace WindowsFormsApplication1 if (persons[nomer].moveside == "Прямо") { - old_place(filename, Person.PersonName(nomer), persons[nomer]); + Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]); } else if (persons[nomer].moveside == "Волнами") { @@ -304,7 +276,7 @@ namespace WindowsFormsApplication1 } else if (persons[nomer].moveside == "Диагонально") { - old_place(filename, Person.PersonName(nomer), persons[nomer]); + Line.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]); } } @@ -314,7 +286,7 @@ namespace WindowsFormsApplication1 { if (persons[nomer].moveside == "Прямо") { - go_pryamo(filename, Person.PersonName(nomer), persons[nomer]); + Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]); } else if (persons[nomer].moveside == "Волнами") { @@ -326,7 +298,7 @@ namespace WindowsFormsApplication1 } else if (persons[nomer].moveside == "Диагонально") { - go_pryamo(filename, Person.PersonName(nomer), persons[nomer]); + Line.MovePerson(filename, Person.PersonName(nomer), persons[nomer]); } } diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs index c9f3f24..d58a04f 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs @@ -10,14 +10,14 @@ namespace WindowsFormsApplication1 { public static void CreatePerson(string filename, string name, Person p) { + File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, " Person " + name + ";" + Environment.NewLine); - File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, " " + name + ".texture = txLoadImage(\"Pictures\\\\" + Path.GetFileName(p.adress) + "\"); " + Environment.NewLine); File.AppendAllText(filename, " " + name + ".x = " + p.x1 + ";" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".y = " + p.y1 + ";" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".nomer_kadra = 0;" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".nach_dv = (" + p.y1 + "+" + p.y2 + ")/2;" + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".ampl_y = 150;" + Environment.NewLine); + File.AppendAllText(filename, " " + name + ".ampl_y = abs(" + p.y1 + "-" + name + ".nach_dv)/2;" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".ampl_x = 10;" + Environment.NewLine); } @@ -25,7 +25,11 @@ namespace WindowsFormsApplication1 { File.AppendAllText(filename, " " + name + ".x++;" + Environment.NewLine); File.AppendAllText(filename, " " + name + ".y = " + name + ".nach_dv + " + name + ".ampl_y * sin(" + name + ".x / " + name + ".ampl_x);" + Environment.NewLine); - File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, 55, 86, " + name + ".texture, 55 * " + name + ".nomer_kadra, 0, RGB(0, 255, 255));" + Environment.NewLine); + File.AppendAllText(filename, " txTransparentBlt(txDC(), " + name + ".x, " + name + ".y, "+ + "55, " + + "86, " + + name + ".texture, " + + "55 * " + name + ".nomer_kadra, 0, RGB(255, 255, 255));" + Environment.NewLine); File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, " " + name + ".nomer_kadra++;" + Environment.NewLine); File.AppendAllText(filename, " if (" + name + ".nomer_kadra > 2)" + Environment.NewLine); diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj b/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj index 0caa0fb..455ac51 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj +++ b/WindowsFormsApplication1/WindowsFormsApplication1/WindowsFormsApplication1.csproj @@ -50,6 +50,7 @@ + Form