diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs index 7bed398..e8d8352 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs @@ -167,9 +167,10 @@ namespace WindowsFormsApplication1 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); - File.AppendAllText(filename, " " + name + ".gr_dvigx = 1000; " + Environment.NewLine); } private void go_pryamo(string filename, string name) @@ -238,7 +239,7 @@ namespace WindowsFormsApplication1 } else if (persons[nomer].moveside == "Волнами") { - Sinus.CreatePerson(filename, Person.PersonName(nomer), persons[nomer].coord); + Sinus.CreatePerson(filename, Person.PersonName(nomer), persons[nomer]); } else if (persons[nomer].moveside == "Кругами") { diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs index 287173e..c9f3f24 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/Sinus.cs @@ -8,15 +8,15 @@ namespace WindowsFormsApplication1 { public class Sinus { - public static void CreatePerson(string filename, string name, string xBeg) + 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, " " + name + ".texture = txLoadImage(\"Pictures\\\\Personaj.bmp\");" + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".x = " + xBeg + ";" + Environment.NewLine); - File.AppendAllText(filename, " " + name + ".y = " + xBeg + ";" + 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 = " + name + ".y;" + 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_x = 10;" + Environment.NewLine); }