From 8549ee0da875781a713d8ff8133b8db613898ae1 Mon Sep 17 00:00:00 2001 From: CreepyCrafter24 <33260128+CreepyCrafter24@users.noreply.github.com> Date: Thu, 26 Sep 2019 20:44:45 +0200 Subject: [PATCH] Quick Graphics Wrapper, moved Level testing to singular Binary --- 1/1.cs | 109 ++-- 2/2.cs | 97 ++-- 3/3.cs | 141 +++--- 3g/3.cs | 81 ++- 4/4.cs | 165 +++---- Base/Drawing.cs | 26 +- Base/Minigame.cs | 17 +- LaptopSimulator2015.sln | 50 +- LaptopSimulator2015/FakeDesktop.cs | 24 +- {lv1_t => LevelTest}/App.config | 0 LevelTest/ArrayDialog.Designer.cs | 66 +++ LevelTest/ArrayDialog.cs | 31 ++ .../ArrayDialog.resx | 3 - .../LevelTest.csproj | 19 +- {lv4_t => LevelTest}/MainForm.Designer.cs | 56 +-- LevelTest/MainForm.cs | 49 ++ {lv1_t => LevelTest}/MainForm.resx | 0 LevelTest/Program.cs | 65 +++ .../Properties/AssemblyInfo.cs | 6 +- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Resources.resx | 0 .../Properties/Settings.Designer.cs | 2 +- .../Properties/Settings.settings | 0 lv1_t/MainForm.Designer.cs | 94 ---- lv1_t/MainForm.cs | 140 ------ lv1_t/Program.cs | 28 -- lv1_t/Properties/AssemblyInfo.cs | 36 -- lv1_t/Properties/Resources.Designer.cs | 68 --- lv2_t/App.config | 6 - lv2_t/MainForm.Designer.cs | 93 ---- lv2_t/MainForm.cs | 124 ----- lv2_t/MainForm.resx | 123 ----- lv2_t/Program.cs | 22 - lv2_t/Properties/AssemblyInfo.cs | 36 -- lv2_t/Properties/Resources.Designer.cs | 68 --- lv2_t/Properties/Resources.resx | 117 ----- lv2_t/Properties/Settings.Designer.cs | 29 -- lv2_t/Properties/Settings.settings | 7 - lv2_t/lv2_t.csproj | 89 ---- lv3_t/App.config | 6 - lv3_t/MainForm.Designer.cs | 93 ---- lv3_t/MainForm.cs | 166 ------- lv3_t/MainForm.resx | 123 ----- lv3_t/Program.cs | 22 - lv3_t/Properties/Resources.Designer.cs | 68 --- lv3_t/Properties/Resources.resx | 117 ----- lv3_t/Properties/Settings.Designer.cs | 29 -- lv3_t/Properties/Settings.settings | 7 - lv3_t/lv3_t.csproj | 89 ---- lv3g_t/App.config | 6 - lv3g_t/MainForm.Designer.cs | 93 ---- lv3g_t/MainForm.cs | 467 ------------------ lv3g_t/Program.cs | 22 - lv3g_t/Properties/AssemblyInfo.cs | 36 -- lv3g_t/Properties/Resources.resx | 117 ----- lv3g_t/Properties/Settings.Designer.cs | 29 -- lv3g_t/Properties/Settings.settings | 7 - lv3g_t/lv3g_t.csproj | 89 ---- lv4_t/App.config | 6 - lv4_t/MainForm.cs | 220 --------- lv4_t/MainForm.resx | 123 ----- lv4_t/Program.cs | 22 - lv4_t/Properties/AssemblyInfo.cs | 36 -- lv4_t/Properties/Resources.Designer.cs | 68 --- lv4_t/Properties/Resources.resx | 117 ----- lv4_t/Properties/Settings.Designer.cs | 29 -- lv4_t/Properties/Settings.settings | 7 - lv4_t/lv4_t.csproj | 89 ---- lv_tst_base/App.config | 6 - lv_tst_base/MainForm.Designer.cs | 94 ---- lv_tst_base/MainForm.cs | 77 --- lv_tst_base/MainForm.resx | 123 ----- lv_tst_base/Program.cs | 22 - lv_tst_base/Properties/AssemblyInfo.cs | 36 -- lv_tst_base/Properties/Resources.Designer.cs | 68 --- lv_tst_base/Properties/Resources.resx | 117 ----- lv_tst_base/Properties/Settings.Designer.cs | 29 -- lv_tst_base/Properties/Settings.settings | 7 - lv_tst_base/lv_tst_base.csproj | 89 ---- 79 files changed, 595 insertions(+), 4467 deletions(-) rename {lv1_t => LevelTest}/App.config (100%) create mode 100644 LevelTest/ArrayDialog.Designer.cs create mode 100644 LevelTest/ArrayDialog.cs rename lv3g_t/MainForm.resx => LevelTest/ArrayDialog.resx (96%) rename lv1_t/lv1_t.csproj => LevelTest/LevelTest.csproj (88%) rename {lv4_t => LevelTest}/MainForm.Designer.cs (72%) create mode 100644 LevelTest/MainForm.cs rename {lv1_t => LevelTest}/MainForm.resx (100%) create mode 100644 LevelTest/Program.cs rename {lv3_t => LevelTest}/Properties/AssemblyInfo.cs (90%) rename {lv3g_t => LevelTest}/Properties/Resources.Designer.cs (94%) rename {lv1_t => LevelTest}/Properties/Resources.resx (100%) rename {lv1_t => LevelTest}/Properties/Settings.Designer.cs (97%) rename {lv1_t => LevelTest}/Properties/Settings.settings (100%) delete mode 100644 lv1_t/MainForm.Designer.cs delete mode 100644 lv1_t/MainForm.cs delete mode 100644 lv1_t/Program.cs delete mode 100644 lv1_t/Properties/AssemblyInfo.cs delete mode 100644 lv1_t/Properties/Resources.Designer.cs delete mode 100644 lv2_t/App.config delete mode 100644 lv2_t/MainForm.Designer.cs delete mode 100644 lv2_t/MainForm.cs delete mode 100644 lv2_t/MainForm.resx delete mode 100644 lv2_t/Program.cs delete mode 100644 lv2_t/Properties/AssemblyInfo.cs delete mode 100644 lv2_t/Properties/Resources.Designer.cs delete mode 100644 lv2_t/Properties/Resources.resx delete mode 100644 lv2_t/Properties/Settings.Designer.cs delete mode 100644 lv2_t/Properties/Settings.settings delete mode 100644 lv2_t/lv2_t.csproj delete mode 100644 lv3_t/App.config delete mode 100644 lv3_t/MainForm.Designer.cs delete mode 100644 lv3_t/MainForm.cs delete mode 100644 lv3_t/MainForm.resx delete mode 100644 lv3_t/Program.cs delete mode 100644 lv3_t/Properties/Resources.Designer.cs delete mode 100644 lv3_t/Properties/Resources.resx delete mode 100644 lv3_t/Properties/Settings.Designer.cs delete mode 100644 lv3_t/Properties/Settings.settings delete mode 100644 lv3_t/lv3_t.csproj delete mode 100644 lv3g_t/App.config delete mode 100644 lv3g_t/MainForm.Designer.cs delete mode 100644 lv3g_t/MainForm.cs delete mode 100644 lv3g_t/Program.cs delete mode 100644 lv3g_t/Properties/AssemblyInfo.cs delete mode 100644 lv3g_t/Properties/Resources.resx delete mode 100644 lv3g_t/Properties/Settings.Designer.cs delete mode 100644 lv3g_t/Properties/Settings.settings delete mode 100644 lv3g_t/lv3g_t.csproj delete mode 100644 lv4_t/App.config delete mode 100644 lv4_t/MainForm.cs delete mode 100644 lv4_t/MainForm.resx delete mode 100644 lv4_t/Program.cs delete mode 100644 lv4_t/Properties/AssemblyInfo.cs delete mode 100644 lv4_t/Properties/Resources.Designer.cs delete mode 100644 lv4_t/Properties/Resources.resx delete mode 100644 lv4_t/Properties/Settings.Designer.cs delete mode 100644 lv4_t/Properties/Settings.settings delete mode 100644 lv4_t/lv4_t.csproj delete mode 100644 lv_tst_base/App.config delete mode 100644 lv_tst_base/MainForm.Designer.cs delete mode 100644 lv_tst_base/MainForm.cs delete mode 100644 lv_tst_base/MainForm.resx delete mode 100644 lv_tst_base/Program.cs delete mode 100644 lv_tst_base/Properties/AssemblyInfo.cs delete mode 100644 lv_tst_base/Properties/Resources.Designer.cs delete mode 100644 lv_tst_base/Properties/Resources.resx delete mode 100644 lv_tst_base/Properties/Settings.Designer.cs delete mode 100644 lv_tst_base/Properties/Settings.settings delete mode 100644 lv_tst_base/lv_tst_base.csproj diff --git a/1/1.cs b/1/1.cs index 4a8213f..eec1f67 100644 --- a/1/1.cs +++ b/1/1.cs @@ -60,7 +60,6 @@ namespace LaptopSimulator2015.Levels public Panel desktopIcon { get; set; } public int installerProgressSteps => 500; - uint minigamePrevTime = 0; List enemies; List bullets; @@ -68,79 +67,61 @@ namespace LaptopSimulator2015.Levels double speedMod; bool enemiesCanShoot; - public void gameTick(Graphics e, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; try { - g.Clear(Color.Black); + Random random = new Random(); + if (random.Next(0, 100000) < minigameTime + 1300) + enemies.Add(new Vector2(minigamePanel.Width, random.Next(minigamePanel.Height - 10))); for (int i = 0; i < enemies.Count; i++) { - g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); + enemies[i].X -= 1.2; + if (player.distanceFromSquared(enemies[i]) < 100 | enemies[i].X < 0) + { + throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); + } } + enemiesCanShoot = enemiesCanShoot | !Input.Action; + List enemiesToRemove = new List(); + List bulletsToRemove = new List(); for (int i = 0; i < bullets.Count; i++) { - g.FillRectangle(new SolidBrush(Color.White), new Rectangle(bullets[i].toPoint(), new Size(5, 5))); - } - g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - if (random.Next(0, 100000) < minigameTime + 1300) - enemies.Add(new Vector2(minigamePanel.Width, random.Next(minigamePanel.Height - 10))); - for (int i = 0; i < enemies.Count; i++) + bullets[i].X += 4; + for (int j = 0; j < enemies.Count; j++) { - enemies[i].X -= 1.2; - if (player.distanceFromSquared(enemies[i]) < 100 | enemies[i].X < 0) + if (bullets[i].distanceFromSquared(enemies[j] + new Vector2(2.5f, 2.5f)) < 56.25f) { - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - enemiesCanShoot = enemiesCanShoot | !Input.Action; - List enemiesToRemove = new List(); - List bulletsToRemove = new List(); - for (int i = 0; i < bullets.Count; i++) - { - bullets[i].X += 4; - for (int j = 0; j < enemies.Count; j++) - { - if (bullets[i].distanceFromSquared(enemies[j] + new Vector2(2.5f, 2.5f)) < 56.25f) - { - enemiesToRemove.Add(enemies[j]); - bulletsToRemove.Add(bullets[i]); - } - } - if (bullets[i].X > minigamePanel.Width) + enemiesToRemove.Add(enemies[j]); bulletsToRemove.Add(bullets[i]); + } } - enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); - bullets = bullets.Except(bulletsToRemove.Distinct()).Distinct().ToList(); - speedMod += 0.1; - speedMod = Math.Max(Math.Min(speedMod, 5), 1); - if (Input.Up) - player.Y -= speedMod; - if (Input.Left) - player.X -= speedMod; - if (Input.Down) - player.Y += speedMod; - if (Input.Right) - player.X += speedMod; - if (Input.Action & enemiesCanShoot) - { - bullets.Add(new Vector2(0, 2.5) + player); - enemiesCanShoot = false; - speedMod--; - } + if (bullets[i].X > minigamePanel.Width) + bulletsToRemove.Add(bullets[i]); + } + enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); + bullets = bullets.Except(bulletsToRemove.Distinct()).Distinct().ToList(); + speedMod += 0.1; + speedMod = Math.Max(Math.Min(speedMod, 5), 1); + if (Input.Up) + player.Y -= speedMod; + if (Input.Left) + player.X -= speedMod; + if (Input.Down) + player.Y += speedMod; + if (Input.Right) + player.X += speedMod; + if (Input.Action & enemiesCanShoot) + { + bullets.Add(new Vector2(0, 2.5) + player); + enemiesCanShoot = false; + speedMod--; } - buffer.Render(); - buffer.Dispose(); } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") Misc.closeGameWindow.Invoke(); else Console.WriteLine(ex.ToString()); } } - public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer) + public void initGame(Panel minigamePanel, Timer minigameTimer) { enemies = new List(); bullets = new List(); @@ -150,5 +131,19 @@ namespace LaptopSimulator2015.Levels player.bounds_wrap = true; player.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10); } + + public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + { + g.g.Clear(Color.Black); + for (int i = 0; i < enemies.Count; i++) + { + g.g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); + } + for (int i = 0; i < bullets.Count; i++) + { + g.g.FillRectangle(new SolidBrush(Color.White), new Rectangle(bullets[i].toPoint(), new Size(5, 5))); + } + g.g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); + } } } \ No newline at end of file diff --git a/2/2.cs b/2/2.cs index d276fda..217111a 100644 --- a/2/2.cs +++ b/2/2.cs @@ -61,72 +61,59 @@ namespace LaptopSimulator2015.Levels public Panel desktopIcon { get; set; } public int installerProgressSteps => 500; - uint minigamePrevTime = 0; List enemies; Vector2 player; int lives; - public void gameTick(Graphics e, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; try { - for (int i = 0; i < enemies.Count; i++) - g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); - g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); - Drawing.DrawSizedString(g, lives.ToString(), 7, (player + new PointF(5, 5)).toPointF(), Brushes.White, true); Random random = new Random(); - if (minigameTime != minigamePrevTime) + if (random.Next(0, 100000) < minigameTime + 1300) { - minigamePrevTime = minigameTime; - if (random.Next(0, 100000) < minigameTime + 1300) - { - int tst = random.Next(minigamePanel.Width * 2 + (minigamePanel.Height - 10) * 2); - if (tst <= minigamePanel.Width) - enemies.Add(new Vector2(tst, 0)); - else if (tst <= minigamePanel.Width * 2) - enemies.Add(new Vector2(tst - minigamePanel.Width, minigamePanel.Height - 10)); - else if (tst <= minigamePanel.Width * 2 + minigamePanel.Height - 10) - enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2)); - else - enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2 - minigamePanel.Height + 10)); - } - if (Input.Up) - player.Y -= 5; - if (Input.Left) - player.X -= 5; - if (Input.Down) - player.Y += 5; - if (Input.Right) - player.X += 5; - List enemiesToRemove = new List(); - for (int i = 0; i < enemies.Count; i++) - { - enemies[i].moveTowards(player, Math.Max(6, Math.Sqrt(minigameTime / 100 + 1))); - for (int j = 0; j < enemies.Count; j++) - { - if (i != j && enemies[i].distanceFromSquared(enemies[j]) < 25 && !enemiesToRemove.Contains(enemies[j])) - enemiesToRemove.Add(enemies[i]); - } - if (player.distanceFromSquared(enemies[i]) < 100 && !enemiesToRemove.Contains(enemies[i])) - { - lives--; - enemiesToRemove.Add(enemies[i]); - if (lives <= 0) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); + int tst = random.Next(minigamePanel.Width * 2 + (minigamePanel.Height - 10) * 2); + if (tst <= minigamePanel.Width) + enemies.Add(new Vector2(tst, 0)); + else if (tst <= minigamePanel.Width * 2) + enemies.Add(new Vector2(tst - minigamePanel.Width, minigamePanel.Height - 10)); + else if (tst <= minigamePanel.Width * 2 + minigamePanel.Height - 10) + enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2)); + else + enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2 - minigamePanel.Height + 10)); } - buffer.Render(); - buffer.Dispose(); + if (Input.Up) + player.Y -= 5; + if (Input.Left) + player.X -= 5; + if (Input.Down) + player.Y += 5; + if (Input.Right) + player.X += 5; + List enemiesToRemove = new List(); + for (int i = 0; i < enemies.Count; i++) + { + enemies[i].moveTowards(player, Math.Max(6, Math.Sqrt(minigameTime / 100 + 1))); + for (int j = 0; j < enemies.Count; j++) + { + if (i != j && enemies[i].distanceFromSquared(enemies[j]) < 25 && !enemiesToRemove.Contains(enemies[j])) + enemiesToRemove.Add(enemies[i]); + } + if (player.distanceFromSquared(enemies[i]) < 100 && !enemiesToRemove.Contains(enemies[i])) + { + lives--; + enemiesToRemove.Add(enemies[i]); + if (lives <= 0) + throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); + } + } + enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") Misc.closeGameWindow.Invoke(); else Console.WriteLine(ex.ToString()); } } - public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer) + public void initGame(Panel minigamePanel, Timer minigameTimer) { enemies = new List(); player = new Vector2(minigamePanel.Width / 2, minigamePanel.Height / 2); @@ -134,5 +121,13 @@ namespace LaptopSimulator2015.Levels player.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10); lives = 3; } + + public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + { + for (int i = 0; i < enemies.Count; i++) + g.g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); + g.g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); + g.DrawSizedString(lives.ToString(), 7, (player + new PointF(5, 5)).toPointF(), Brushes.White, true); + } } } diff --git a/3/3.cs b/3/3.cs index b536fcc..9947ad9 100644 --- a/3/3.cs +++ b/3/3.cs @@ -61,8 +61,7 @@ namespace LaptopSimulator2015.Levels public Panel desktopIcon { get; set; } public int installerProgressSteps => 500; - uint minigamePrevTime = 0; - + Vector2 center; Vector2 cannon; Vector2 targ; @@ -74,94 +73,65 @@ namespace LaptopSimulator2015.Levels bool firing; uint lastTarget; - public void gameTick(Graphics e, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; try { - g.Clear(Color.Black); - g.FillRectangle(new SolidBrush(Color.Green), player); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 5), center.toPoint(), cannon.toPoint()); - for (int i = 0; i < targets.Count; i++) + Random random = new Random(); + if (minigameTime - lastTarget > 90 + 40 / (minigameTime / 100 + 1)) { - g.DrawEllipse(new Pen(new SolidBrush(Color.Red), 6), new RectangleF(Misc.d2f(targets[i].X - 10), Misc.d2f(targets[i].Y - 10), 20, 20)); - g.DrawEllipse(new Pen(new SolidBrush(Color.White), 6), new RectangleF(Misc.d2f(targets[i].X - 7), Misc.d2f(targets[i].Y - 7), 14, 14)); - g.FillEllipse(new SolidBrush(Color.Red), new RectangleF(Misc.d2f(targets[i].X - 3), Misc.d2f(targets[i].Y - 3), 6, 6)); - g.DrawLine(new Pen(new SolidBrush(Color.Gray), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + 13), Misc.d2f(targets[i].Y - 15)); - g.DrawLine(new Pen(new SolidBrush(Color.Red), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + ((((double)targets[i].Tag) * 0.2) - 12.9) + 0.1), Misc.d2f(targets[i].Y - 15)); + targets.Add(new Vector2(random.Next(minigamePanel.Height + 25) + (minigamePanel.Width - minigamePanel.Height - 50) / 2, random.Next(minigamePanel.Height))); + targets[targets.Count - 1].Tag = (double)130; + lastTarget = minigameTime; } - if (firing) + cannon = new Vector2(center); + cannon.moveInDirection(Misc.deg2rad(playerRot), 20); + if (Input.Action) { - g.DrawRectangle(new Pen(new SolidBrush(Color.Green), 1), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y - power / 2)), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y + power / 2))); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y)), new PointF(Misc.d2i(targ.X + power / 2), Misc.d2i(targ.Y))); + firing = true; + power = Math.Min(power + 5, 100); } else + if (firing) { - g.FillRectangle(new SolidBrush(Color.Green), new RectangleF(Misc.d2f(targ.X - 2.5f), Misc.d2f(targ.Y - 2.5f), 5, 5)); - } - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - if (minigameTime - lastTarget > 90 + 40 / (minigameTime / 100 + 1)) - { - targets.Add(new Vector2(random.Next(minigamePanel.Height + 25) + (minigamePanel.Width - minigamePanel.Height - 50) / 2, random.Next(minigamePanel.Height))); - targets[targets.Count - 1].Tag = (double)130; - lastTarget = minigameTime; - } - cannon = new Vector2(center); - cannon.moveInDirection(Misc.deg2rad(playerRot), 20); - if (Input.Action) - { - firing = true; - power = Math.Min(power + 5, 100); - } - else - if (firing) - { - firing = false; - List targetsToRemove = new List(); - for (int i = 0; i < targets.Count; i++) - { - if (targets[i].distanceFromSquared(targ) <= Math.Pow(power + 10, 2)) - targetsToRemove.Add(targets[i]); - } - targets = targets.Except(targetsToRemove.Distinct()).Distinct().ToList(); - g.FillRectangle(new SolidBrush(Color.White), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); - power = 10; - } - targ = new Vector2(center); - targ.Tag = playerRot; - if (Input.Up) - cannonL += 100 / power; - if (Input.Down) - cannonL -= 100 / power; - if (Input.Right) - playerRot += 80 / power; - if (Input.Left) - playerRot -= 80 / power; - while (playerRot > 360) - playerRot -= 360; - while (playerRot < 0) - playerRot += 360; - cannonL = Math.Max(Math.Min(cannonL, minigamePanel.Height / 2), 22.5f); - targ.moveInDirection(Misc.deg2rad((double)targ.Tag), cannonL); + firing = false; + List targetsToRemove = new List(); for (int i = 0; i < targets.Count; i++) { - targets[i].Tag = ((double)targets[i].Tag) - 1; - if ((double)targets[i].Tag <= 0) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); + if (targets[i].distanceFromSquared(targ) <= Math.Pow(power + 10, 2)) + targetsToRemove.Add(targets[i]); } + targets = targets.Except(targetsToRemove.Distinct()).Distinct().ToList(); + g.g.FillRectangle(new SolidBrush(Color.White), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); + power = 10; + } + targ = new Vector2(center); + targ.Tag = playerRot; + if (Input.Up) + cannonL += 100 / power; + if (Input.Down) + cannonL -= 100 / power; + if (Input.Right) + playerRot += 80 / power; + if (Input.Left) + playerRot -= 80 / power; + while (playerRot > 360) + playerRot -= 360; + while (playerRot < 0) + playerRot += 360; + cannonL = Math.Max(Math.Min(cannonL, minigamePanel.Height / 2), 22.5f); + targ.moveInDirection(Misc.deg2rad((double)targ.Tag), cannonL); + for (int i = 0; i < targets.Count; i++) + { + targets[i].Tag = ((double)targets[i].Tag) - 1; + if ((double)targets[i].Tag <= 0) + throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); } - buffer.Render(); - buffer.Dispose(); } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") Misc.closeGameWindow.Invoke(); else Console.WriteLine(ex.ToString()); } } - public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer) + public void initGame(Panel minigamePanel, Timer minigameTimer) { center = new Vector2(minigamePanel.Width / 2, minigamePanel.Height / 2); cannon = new Vector2(center); @@ -173,5 +143,30 @@ namespace LaptopSimulator2015.Levels firing = false; lastTarget = 0; } + + public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + { + g.g.Clear(Color.Black); + g.g.FillRectangle(new SolidBrush(Color.Green), player); + g.g.DrawLine(new Pen(new SolidBrush(Color.Green), 5), center.toPoint(), cannon.toPoint()); + for (int i = 0; i < targets.Count; i++) + { + g.g.DrawEllipse(new Pen(new SolidBrush(Color.Red), 6), new RectangleF(Misc.d2f(targets[i].X - 10), Misc.d2f(targets[i].Y - 10), 20, 20)); + g.g.DrawEllipse(new Pen(new SolidBrush(Color.White), 6), new RectangleF(Misc.d2f(targets[i].X - 7), Misc.d2f(targets[i].Y - 7), 14, 14)); + g.g.FillEllipse(new SolidBrush(Color.Red), new RectangleF(Misc.d2f(targets[i].X - 3), Misc.d2f(targets[i].Y - 3), 6, 6)); + g.g.DrawLine(new Pen(new SolidBrush(Color.Gray), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + 13), Misc.d2f(targets[i].Y - 15)); + g.g.DrawLine(new Pen(new SolidBrush(Color.Red), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + ((((double)targets[i].Tag) * 0.2) - 12.9) + 0.1), Misc.d2f(targets[i].Y - 15)); + } + if (firing) + { + g.g.DrawRectangle(new Pen(new SolidBrush(Color.Green), 1), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); + g.g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y - power / 2)), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y + power / 2))); + g.g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y)), new PointF(Misc.d2i(targ.X + power / 2), Misc.d2i(targ.Y))); + } + else + { + g.g.FillRectangle(new SolidBrush(Color.Green), new RectangleF(Misc.d2f(targ.X - 2.5f), Misc.d2f(targ.Y - 2.5f), 5, 5)); + } + } } } diff --git a/3g/3.cs b/3g/3.cs index 100aa22..2d9b7c3 100644 --- a/3g/3.cs +++ b/3g/3.cs @@ -79,8 +79,7 @@ namespace LaptopSimulator2015.Goals } } - public static uint minigamePrevTime; - + public static int[,] grid = new int[23, 10]; public static int[,] droppedtetrominoeLocationGrid = new int[23, 10]; public static bool isDropped = false; @@ -88,57 +87,32 @@ namespace LaptopSimulator2015.Goals static Tetrominoe nexttet; public static int linesCleared = 0, score = 0, level = 1; public static Random rnd; - public void gameTick(Graphics e, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; try { - g.Clear(Color.Black); - for (int y = 0; y < 23; ++y) - { - for (int x = 0; x < 10; x++) - { - if (grid[y, x] == 1 | droppedtetrominoeLocationGrid[y, x] == 1) - g.FillRectangle(Brushes.White, new Rectangle(x * 10, y * 10, 10, 10)); - } - g.DrawLine(new Pen(Color.DarkGray), new Point(0, (y + 1) * 10), new Point(10 * 10, (y + 1) * 10)); - } - for (int x = 0; x < 10; x++) - { - g.DrawLine(new Pen(Color.DarkGray), new Point((x + 1) * 10, 0), new Point((x + 1) * 10, 23 * 10)); - } - Drawing.DrawSizedString(g, "Level " + level, 10, new PointF(150, 10), Brushes.White); - Drawing.DrawSizedString(g, "Score " + score, 10, new PointF(150, 30), Brushes.White); - Drawing.DrawSizedString(g, "LinesCleared " + linesCleared, 10, new PointF(150, 50), Brushes.White); Random random = new Random(); - if (minigameTime != minigamePrevTime) + tet.Drop(); + if (isDropped == true) { - minigamePrevTime = minigameTime; - tet.Drop(); - if (isDropped == true) - { - tet = nexttet; - nexttet = new Tetrominoe(); - tet.Spawn(); - isDropped = false; - score += 10; - } - int j; for (j = 0; j < 10; j++) - { - if (droppedtetrominoeLocationGrid[0, j] == 1) - Misc.closeGameWindow.Invoke(); - } - Input(); - ClearBlock(); + tet = nexttet; + nexttet = new Tetrominoe(); + tet.Spawn(); + isDropped = false; + score += 10; } - buffer.Render(); - buffer.Dispose(); + int j; for (j = 0; j < 10; j++) + { + if (droppedtetrominoeLocationGrid[0, j] == 1) + Misc.closeGameWindow.Invoke(); + } + Input(); + ClearBlock(); } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") Misc.closeGameWindow.Invoke(); else Console.WriteLine(ex.ToString()); } } - public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer) + public void initGame(Panel minigamePanel, Timer minigameTimer) { rnd = new Random(); grid = new int[23, 10]; @@ -222,6 +196,27 @@ namespace LaptopSimulator2015.Goals } } + public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + { + g.g.Clear(Color.Black); + for (int y = 0; y < 23; ++y) + { + for (int x = 0; x < 10; x++) + { + if (grid[y, x] == 1 | droppedtetrominoeLocationGrid[y, x] == 1) + g.g.FillRectangle(Brushes.White, new Rectangle(x * 10, y * 10, 10, 10)); + } + g.g.DrawLine(new Pen(Color.DarkGray), new Point(0, (y + 1) * 10), new Point(10 * 10, (y + 1) * 10)); + } + for (int x = 0; x < 10; x++) + { + g.g.DrawLine(new Pen(Color.DarkGray), new Point((x + 1) * 10, 0), new Point((x + 1) * 10, 23 * 10)); + } + g.DrawSizedString("Level " + level, 10, new PointF(150, 10), Brushes.White); + g.DrawSizedString("Score " + score, 10, new PointF(150, 30), Brushes.White); + g.DrawSizedString("LinesCleared " + linesCleared, 10, new PointF(150, 50), Brushes.White); + } + public class Tetrominoe { public static int[,] I = new int[1, 4] { { 1, 1, 1, 1 } }; diff --git a/4/4.cs b/4/4.cs index 1871991..3de222f 100644 --- a/4/4.cs +++ b/4/4.cs @@ -55,7 +55,6 @@ namespace LaptopSimulator2015.Levels public int gameClock => 17; public Panel desktopIcon { get; set; } public int installerProgressSteps => 500; - uint minigamePrevTime = 0; Random rnd; Vector2 player; @@ -66,105 +65,88 @@ namespace LaptopSimulator2015.Levels int jmpj; bool wasOnPlatform; List platforms; - public void gameTick(Graphics e, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + public void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; try { - g.Clear(Color.Black); - g.FillRectangle(new SolidBrush(Color.Green), player2rect()); - if (lazorTime >= 0 && lazorTime <= 80) - { - g.FillRectangle(new SolidBrush(Color.DarkGray), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height)); - g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height - (float)Misc.map(0, 80, 0, minigamePanel.Height, lazorTime))); - } - for (int i = 0; i < platforms.Count; i++) - g.FillRectangle(new SolidBrush(Color.White), plat2rect(i)); Random random = new Random(); - if (minigameTime != minigamePrevTime) + speed = Math.Min(minigameTime / 200d, 2) + 0.5; + lazorTime -= Math.Min(minigameTime / 800, 2.5) + 0.5; + if (lazorTime <= 0) { - speed = Math.Min(minigameTime / 200d, 2) + 0.5; - lazorTime -= Math.Min(minigameTime / 800, 2.5) + 0.5; - minigamePrevTime = minigameTime; - if (lazorTime <= 0) + g.g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 5, 0, 10, minigamePanel.Height)); + if (lazorTime <= -2) { - g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 5, 0, 10, minigamePanel.Height)); - if (lazorTime <= -2) - { - lazorTime = 100; - lazor = player.X; - } - else - { - if (player.X > lazor - 10 && player.X < lazor + 10) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - player.Y += speed; - for (int i = 0; i < platforms.Count; i++) - { - platforms[i].Y += speed; - if (platforms[i].Y > minigamePanel.Height) - { - platforms[i].Y = 0; - platforms[i].X = rnd.Next(minigamePanel.Width); - } - } - double movementFactor; - if (wasOnPlatform) - { - movementFactor = 2; - playerV.X *= 0.7; - playerV.Y = Math.Min(playerV.Y, 0); + lazorTime = 100; + lazor = player.X; } else { - movementFactor = 5; - playerV.X *= 0.9; - playerV.Y += 1; + if (player.X > lazor - 10 && player.X < lazor + 10) + throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); } - if (Input.Up) - { - if (wasOnPlatform || jmpj > 0) - { - playerV.Y -= jmpj / 6d + 1.5; - jmpj--; - } - } - else - { - if (wasOnPlatform) - jmpj = 10; - else - jmpj = 0; - } - jmpj = Math.Max(0, jmpj); - if (Input.Left) - playerV.X -= movementFactor; - if (Input.Right) - playerV.X += movementFactor; - player.X += playerV.X; - if (playerV.Y < 0) - player.Y += playerV.Y; - else - for (int i = 0; i < playerV.Y / 2; i++) - { - if (onPlatform) - break; - player.Y += 2; - } - if (player.Y > minigamePanel.Height) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - wasOnPlatform = onPlatform; } - buffer.Render(); - buffer.Dispose(); + player.Y += speed; + for (int i = 0; i < platforms.Count; i++) + { + platforms[i].Y += speed; + if (platforms[i].Y > minigamePanel.Height) + { + platforms[i].Y = 0; + platforms[i].X = rnd.Next(minigamePanel.Width); + } + } + double movementFactor; + if (wasOnPlatform) + { + movementFactor = 2; + playerV.X *= 0.7; + playerV.Y = Math.Min(playerV.Y, 0); + } + else + { + movementFactor = 5; + playerV.X *= 0.9; + playerV.Y += 1; + } + if (Input.Up) + { + if (wasOnPlatform || jmpj > 0) + { + playerV.Y -= jmpj / 6d + 1.5; + jmpj--; + } + } + else + { + if (wasOnPlatform) + jmpj = 10; + else + jmpj = 0; + } + jmpj = Math.Max(0, jmpj); + if (Input.Left) + playerV.X -= movementFactor; + if (Input.Right) + playerV.X += movementFactor; + player.X += playerV.X; + if (playerV.Y < 0) + player.Y += playerV.Y; + else + for (int i = 0; i < playerV.Y / 2; i++) + { + if (onPlatform) + break; + player.Y += 2; + } + if (player.Y > minigamePanel.Height) + throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); + wasOnPlatform = onPlatform; } catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") Misc.closeGameWindow.Invoke(); else Console.WriteLine(ex.ToString()); } } - public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer) + public void initGame(Panel minigamePanel, Timer minigameTimer) { rnd = new Random(); playerV = new Vector2(); @@ -226,5 +208,18 @@ namespace LaptopSimulator2015.Levels } RectangleF plat2rect(int platform) => new RectangleF((platforms[platform] - new Vector2(50, 5)).toPointF(), new SizeF(100, 10)); RectangleF player2rect() => new RectangleF((player - new Vector2(5, 5)).toPointF(), new SizeF(10, 10)); + + public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime) + { + g.g.Clear(Color.Black); + g.g.FillRectangle(new SolidBrush(Color.Green), player2rect()); + if (lazorTime >= 0 && lazorTime <= 80) + { + g.g.FillRectangle(new SolidBrush(Color.DarkGray), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height)); + g.g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height - (float)Misc.map(0, 80, 0, minigamePanel.Height, lazorTime))); + } + for (int i = 0; i < platforms.Count; i++) + g.g.FillRectangle(new SolidBrush(Color.White), plat2rect(i)); + } } } diff --git a/Base/Drawing.cs b/Base/Drawing.cs index 73a391d..0fa35c4 100644 --- a/Base/Drawing.cs +++ b/Base/Drawing.cs @@ -8,18 +8,30 @@ using System.Threading.Tasks; namespace Base { - public static class Drawing + public class GraphicsWrapper : IDisposable { + BufferedGraphics _g; + public readonly Graphics g; + /// + /// Wrap the Graphics object with these excellent High-Quality functions + /// + /// The Graphics-object to wrap + /// The size of the device the Graphics are drawn to + public GraphicsWrapper(Graphics g, Rectangle targetSize) + { + _g = BufferedGraphicsManager.Current.Allocate(g ?? throw new ArgumentNullException(nameof(g)), targetSize); + this.g = _g.Graphics; + } + /// /// Draw a string with the given size /// - /// The graphics object to draw the string on /// The string to draw /// The font size of the string /// The location to draw the string at /// The brush to draw the string with /// Set to true if you want to draw the string around instead of left-down from the location - public static void DrawSizedString(Graphics g, string s, int size, PointF location, Brush brush, bool isLocationCentered = false) + public void DrawSizedString(string s, int size, PointF location, Brush brush, bool isLocationCentered = false) { SmoothingMode tmpS = g.SmoothingMode; InterpolationMode tmpI = g.InterpolationMode; @@ -38,5 +50,13 @@ namespace Base g.InterpolationMode = tmpI; g.SmoothingMode = tmpS; } + + public void Dispose() + { + g.Flush(); + _g.Render(); + g.Dispose(); + _g.Dispose(); + } } } diff --git a/Base/Minigame.cs b/Base/Minigame.cs index ab8060c..344e3a7 100644 --- a/Base/Minigame.cs +++ b/Base/Minigame.cs @@ -1,4 +1,5 @@ -using System; +using Base; +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -36,15 +37,23 @@ namespace LaptopSimulator2015 /// A temporary Graphics object, should not be used /// The panel on which the minigame is displayed /// The timer used for scheduling frames - void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer); + void initGame(Panel minigamePanel, Timer minigameTimer); /// - /// Called each frame + /// Called physics frame /// /// Graphics object, to be used for drawing the scene /// The panel on which the minigame is displayed /// The timer used for scheduling frames /// The amount of total displayed frames - void gameTick(Graphics g, Panel minigamePanel, Timer minigameTimer, uint minigameTime); + void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime); + /// + /// Called graphics frame + /// + /// Graphics object, to be used for drawing the scene + /// The panel on which the minigame is displayed + /// The timer used for scheduling frames + /// The amount of total displayed frames + void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime); } public interface Level : Minigame { diff --git a/LaptopSimulator2015.sln b/LaptopSimulator2015.sln index 952add1..40c3f2b 100644 --- a/LaptopSimulator2015.sln +++ b/LaptopSimulator2015.sln @@ -16,28 +16,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaptopSimulator2015", "Lapt {B97A24F8-8027-471A-B688-8BC5D49B21D7} = {B97A24F8-8027-471A-B688-8BC5D49B21D7} EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Minigame Tests", "Minigame Tests", "{69DC5824-3F89-4B47-BF1A-F25942094195}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Levels", "Levels", "{83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Base", "Base\Base.csproj", "{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "1", "1\1.csproj", "{DFA2FB97-D676-4B0D-B281-2685F85781EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv_tst_base", "lv_tst_base\lv_tst_base.csproj", "{52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv1_t", "lv1_t\lv1_t.csproj", "{D80DBBF2-307F-40A0-86F1-871C8DAA394B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv2_t", "lv2_t\lv2_t.csproj", "{741EE70E-4CED-40EB-89F2-BD77D41FECED}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2", "2\2.csproj", "{0965C803-49B2-4311-B62F-1E60DBD9185F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv3_t", "lv3_t\lv3_t.csproj", "{244E68E6-90D2-447D-B380-13CA8DD3D4EC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3", "3\3.csproj", "{8109040E-9D8D-43E7-A461-83475B2939C9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv4_t", "lv4_t\lv4_t.csproj", "{22D618C0-F0A4-417F-A815-C760BF4376B2}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4", "4\4.csproj", "{4AA1EF48-BC5E-4FE4-9B7D-BAE6D6AB9529}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{23D851A7-722E-416A-91F8-0C86349D5BF3}" @@ -49,8 +37,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Goals", "Goals", "{7D9F2BFD EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3g", "3g\3g.csproj", "{E61E2797-62B4-471C-ACBF-31EAB7C746CF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lv3g_t", "lv3g_t\lv3g_t.csproj", "{E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Glitches", "Glitches", "{A8CDDCD3-43FC-46AE-9132-24DE27808D96}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptchaGlitch_Rand", "CaptchaGlitch_Rand\CaptchaGlitch_Rand.csproj", "{72BBB6B8-5DA3-4FF1-8FA6-75256637F931}" @@ -61,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptchaGlitch_Double", "Cap EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zzz_ShuffleChars", "zzz_ShuffleChars\zzz_ShuffleChars.csproj", "{5E10F1D0-0114-444A-B80E-975B5DC40D9F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LevelTest", "LevelTest\LevelTest.csproj", "{DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -79,34 +67,14 @@ Global {DFA2FB97-D676-4B0D-B281-2685F85781EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFA2FB97-D676-4B0D-B281-2685F85781EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFA2FB97-D676-4B0D-B281-2685F85781EE}.Release|Any CPU.Build.0 = Release|Any CPU - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}.Release|Any CPU.Build.0 = Release|Any CPU - {D80DBBF2-307F-40A0-86F1-871C8DAA394B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D80DBBF2-307F-40A0-86F1-871C8DAA394B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D80DBBF2-307F-40A0-86F1-871C8DAA394B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D80DBBF2-307F-40A0-86F1-871C8DAA394B}.Release|Any CPU.Build.0 = Release|Any CPU - {741EE70E-4CED-40EB-89F2-BD77D41FECED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {741EE70E-4CED-40EB-89F2-BD77D41FECED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {741EE70E-4CED-40EB-89F2-BD77D41FECED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {741EE70E-4CED-40EB-89F2-BD77D41FECED}.Release|Any CPU.Build.0 = Release|Any CPU {0965C803-49B2-4311-B62F-1E60DBD9185F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0965C803-49B2-4311-B62F-1E60DBD9185F}.Debug|Any CPU.Build.0 = Debug|Any CPU {0965C803-49B2-4311-B62F-1E60DBD9185F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0965C803-49B2-4311-B62F-1E60DBD9185F}.Release|Any CPU.Build.0 = Release|Any CPU - {244E68E6-90D2-447D-B380-13CA8DD3D4EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {244E68E6-90D2-447D-B380-13CA8DD3D4EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {244E68E6-90D2-447D-B380-13CA8DD3D4EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {244E68E6-90D2-447D-B380-13CA8DD3D4EC}.Release|Any CPU.Build.0 = Release|Any CPU {8109040E-9D8D-43E7-A461-83475B2939C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8109040E-9D8D-43E7-A461-83475B2939C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {8109040E-9D8D-43E7-A461-83475B2939C9}.Release|Any CPU.ActiveCfg = Release|Any CPU {8109040E-9D8D-43E7-A461-83475B2939C9}.Release|Any CPU.Build.0 = Release|Any CPU - {22D618C0-F0A4-417F-A815-C760BF4376B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22D618C0-F0A4-417F-A815-C760BF4376B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22D618C0-F0A4-417F-A815-C760BF4376B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22D618C0-F0A4-417F-A815-C760BF4376B2}.Release|Any CPU.Build.0 = Release|Any CPU {4AA1EF48-BC5E-4FE4-9B7D-BAE6D6AB9529}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4AA1EF48-BC5E-4FE4-9B7D-BAE6D6AB9529}.Debug|Any CPU.Build.0 = Debug|Any CPU {4AA1EF48-BC5E-4FE4-9B7D-BAE6D6AB9529}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -115,10 +83,6 @@ Global {E61E2797-62B4-471C-ACBF-31EAB7C746CF}.Debug|Any CPU.Build.0 = Debug|Any CPU {E61E2797-62B4-471C-ACBF-31EAB7C746CF}.Release|Any CPU.ActiveCfg = Release|Any CPU {E61E2797-62B4-471C-ACBF-31EAB7C746CF}.Release|Any CPU.Build.0 = Release|Any CPU - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}.Release|Any CPU.Build.0 = Release|Any CPU {72BBB6B8-5DA3-4FF1-8FA6-75256637F931}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {72BBB6B8-5DA3-4FF1-8FA6-75256637F931}.Debug|Any CPU.Build.0 = Debug|Any CPU {72BBB6B8-5DA3-4FF1-8FA6-75256637F931}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -135,22 +99,20 @@ Global {5E10F1D0-0114-444A-B80E-975B5DC40D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5E10F1D0-0114-444A-B80E-975B5DC40D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5E10F1D0-0114-444A-B80E-975B5DC40D9F}.Release|Any CPU.Build.0 = Release|Any CPU + {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {DFA2FB97-D676-4B0D-B281-2685F85781EE} = {83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218} - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202} = {69DC5824-3F89-4B47-BF1A-F25942094195} - {D80DBBF2-307F-40A0-86F1-871C8DAA394B} = {69DC5824-3F89-4B47-BF1A-F25942094195} - {741EE70E-4CED-40EB-89F2-BD77D41FECED} = {69DC5824-3F89-4B47-BF1A-F25942094195} {0965C803-49B2-4311-B62F-1E60DBD9185F} = {83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218} - {244E68E6-90D2-447D-B380-13CA8DD3D4EC} = {69DC5824-3F89-4B47-BF1A-F25942094195} {8109040E-9D8D-43E7-A461-83475B2939C9} = {83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218} - {22D618C0-F0A4-417F-A815-C760BF4376B2} = {69DC5824-3F89-4B47-BF1A-F25942094195} {4AA1EF48-BC5E-4FE4-9B7D-BAE6D6AB9529} = {83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218} {E61E2797-62B4-471C-ACBF-31EAB7C746CF} = {7D9F2BFD-61B6-4C6C-97CC-D9AD51A04959} - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E} = {69DC5824-3F89-4B47-BF1A-F25942094195} {72BBB6B8-5DA3-4FF1-8FA6-75256637F931} = {A8CDDCD3-43FC-46AE-9132-24DE27808D96} {048BCC52-64BA-452B-A3F6-3683F9049AFD} = {A8CDDCD3-43FC-46AE-9132-24DE27808D96} {B97A24F8-8027-471A-B688-8BC5D49B21D7} = {A8CDDCD3-43FC-46AE-9132-24DE27808D96} diff --git a/LaptopSimulator2015/FakeDesktop.cs b/LaptopSimulator2015/FakeDesktop.cs index 8b7dbc2..b973089 100644 --- a/LaptopSimulator2015/FakeDesktop.cs +++ b/LaptopSimulator2015/FakeDesktop.cs @@ -107,8 +107,7 @@ namespace LaptopSimulator2015 IEnumerable tmp_types = tmpdirs.Select(s => Assembly.LoadFrom(s)).SelectMany(s => s.GetTypes()).Distinct(); levels = tmp_types.Where(p => typeof(Minigame).IsAssignableFrom(p)).Distinct().Except(new Type[] { typeof(Minigame), typeof(Level), typeof(Goal) }) .Select(s => (Minigame)Activator.CreateInstance(s)).OrderBy(lv => lv.availableAfter).ToList(); -#if true || DEBUG - //tmpdirs.Select(s => devWindowDllList.Items.Add(s)); +#if DEBUG devWindowDllList.Items.AddRange(tmpdirs.ToArray()); devWindowLevelList.Items.AddRange(levels.Select(s => s.availableAfter.ToString() + " - " + s.name + (typeof(Goal).IsAssignableFrom(s.GetType()) ? (" - " + ((Goal)s).playableAfter.ToString() + " (Goal)") : " (Level)")).ToArray()); #endif @@ -166,13 +165,11 @@ namespace LaptopSimulator2015 Goal goal = ((Goal)levels[levelInd]); if (goal.playableAfter <= Settings.level) { - Graphics g = minigamePanel.CreateGraphics(); - levels[levelInd].initGame(g, minigamePanel, minigameClockT); + levels[levelInd].initGame(minigamePanel, minigameClockT); minigamePanel.Visible = true; minigamePanel.Enabled = true; minigameClockT.Enabled = true; minigameClose.Visible = true; - g.Flush(); Misc.closeGameWindow = new Action(() => { base.BackColor = Color.FromArgb(100, 0, 255); minigamePanel.Visible = false; @@ -235,7 +232,6 @@ namespace LaptopSimulator2015 } #if DEBUG devWindowLevelList.SelectedIndex = levels.FindIndex(s => s.availableAfter == Settings.level); - //Settings.level = levels[devWindowLevelList.SelectedIndex].availableAfter; #endif } @@ -372,7 +368,7 @@ namespace LaptopSimulator2015 levelWindowProgressT.Enabled = true; minigameTime = 0; Graphics g = minigamePanel.CreateGraphics(); - levels[levelInd].initGame(g, minigamePanel, minigameClockT); + levels[levelInd].initGame(minigamePanel, minigameClockT); minigamePanel.Visible = true; minigamePanel.Enabled = true; minigameClockT.Enabled = true; @@ -476,7 +472,19 @@ namespace LaptopSimulator2015 #region Minigame uint minigameTime = 0; - private void InvadersPanel_Paint(object sender, PaintEventArgs e) => levels[levelInd].gameTick(e.Graphics, minigamePanel, minigameClockT, minigameTime); + uint minigamePrevTime = 0; + private void InvadersPanel_Paint(object sender, PaintEventArgs e) + { + using (GraphicsWrapper w = new GraphicsWrapper(e.Graphics, new Rectangle(Point.Empty, minigamePanel.Size))) + { + levels[levelInd].draw(w, minigamePanel, minigameClockT, minigameTime); + if (minigameTime != minigamePrevTime) + { + levels[levelInd].gameTick(w, minigamePanel, minigameClockT, minigameTime); + minigamePrevTime = minigameTime; + } + } + } private void InvadersTimer_Tick(object sender, EventArgs e) { diff --git a/lv1_t/App.config b/LevelTest/App.config similarity index 100% rename from lv1_t/App.config rename to LevelTest/App.config diff --git a/LevelTest/ArrayDialog.Designer.cs b/LevelTest/ArrayDialog.Designer.cs new file mode 100644 index 0000000..0ee8f9b --- /dev/null +++ b/LevelTest/ArrayDialog.Designer.cs @@ -0,0 +1,66 @@ +namespace LevelTest +{ + partial class ArrayDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listBox1.FormattingEnabled = true; + this.listBox1.Location = new System.Drawing.Point(0, 0); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(482, 262); + this.listBox1.TabIndex = 0; + this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged); + // + // ArrayDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(482, 262); + this.ControlBox = false; + this.Controls.Add(this.listBox1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ArrayDialog"; + this.ShowIcon = false; + this.Text = "ArrayDialog"; + this.TopMost = true; + this.Load += new System.EventHandler(this.ArrayDialog_Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListBox listBox1; + } +} \ No newline at end of file diff --git a/LevelTest/ArrayDialog.cs b/LevelTest/ArrayDialog.cs new file mode 100644 index 0000000..b08f98f --- /dev/null +++ b/LevelTest/ArrayDialog.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace LevelTest +{ + public partial class ArrayDialog : Form + { + public int returnIndex; + public ArrayDialog(string[] items) + { + InitializeComponent(); + listBox1.Items.AddRange(items); + } + + private void ListBox1_SelectedIndexChanged(object sender, EventArgs e) + { + returnIndex = listBox1.SelectedIndex; + DialogResult = DialogResult.OK; + Close(); + } + + private void ArrayDialog_Load(object sender, EventArgs e) => BringToFront(); + } +} diff --git a/lv3g_t/MainForm.resx b/LevelTest/ArrayDialog.resx similarity index 96% rename from lv3g_t/MainForm.resx rename to LevelTest/ArrayDialog.resx index 7925979..1af7de1 100644 --- a/lv3g_t/MainForm.resx +++ b/LevelTest/ArrayDialog.resx @@ -117,7 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - \ No newline at end of file diff --git a/lv1_t/lv1_t.csproj b/LevelTest/LevelTest.csproj similarity index 88% rename from lv1_t/lv1_t.csproj rename to LevelTest/LevelTest.csproj index 535edea..cd0c24a 100644 --- a/lv1_t/lv1_t.csproj +++ b/LevelTest/LevelTest.csproj @@ -4,10 +4,10 @@ Debug AnyCPU - {D80DBBF2-307F-40A0-86F1-871C8DAA394B} + {DFD89655-00A7-4DF8-8B2E-17F5BEFE5090} WinExe - SIT - SIT + LevelTest + LevelTest v4.7.2 512 true @@ -46,6 +46,12 @@ + + Form + + + ArrayDialog.cs + Form @@ -54,6 +60,9 @@ + + ArrayDialog.cs + MainForm.cs @@ -86,8 +95,4 @@ - - - - \ No newline at end of file diff --git a/lv4_t/MainForm.Designer.cs b/LevelTest/MainForm.Designer.cs similarity index 72% rename from lv4_t/MainForm.Designer.cs rename to LevelTest/MainForm.Designer.cs index 39453d6..2c7dac9 100644 --- a/lv4_t/MainForm.Designer.cs +++ b/LevelTest/MainForm.Designer.cs @@ -1,4 +1,4 @@ -namespace lv4_t +namespace LevelTest { partial class MainForm { @@ -29,33 +29,14 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.button1 = new System.Windows.Forms.Button(); this.minigamePanel = new System.Windows.Forms.Panel(); - this.minigamePanel.SuspendLayout(); + this.minigameClockT = new System.Windows.Forms.Timer(this.components); + this.closeButton = new System.Windows.Forms.Label(); this.SuspendLayout(); // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 17; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // // minigamePanel // this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; this.minigamePanel.Location = new System.Drawing.Point(0, 0); this.minigamePanel.Name = "minigamePanel"; @@ -63,31 +44,42 @@ this.minigamePanel.TabIndex = 1; this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.MinigamePanel_Paint); // + // minigameClockT + // + this.minigameClockT.Enabled = true; + this.minigameClockT.Interval = 17; + this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); + // + // closeButton + // + this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeButton.BackColor = System.Drawing.Color.Red; + this.closeButton.Location = new System.Drawing.Point(776, 2); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(23, 23); + this.closeButton.TabIndex = 0; + this.closeButton.Text = "X"; + this.closeButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.closeButton.Click += new System.EventHandler(this.CloseButton_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; + this.Controls.Add(this.closeButton); this.Controls.Add(this.minigamePanel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; - this.minigamePanel.ResumeLayout(false); this.ResumeLayout(false); } #endregion - - private System.Windows.Forms.Timer minigameClockT; - private System.Windows.Forms.Button button1; private System.Windows.Forms.Panel minigamePanel; + private System.Windows.Forms.Timer minigameClockT; + private System.Windows.Forms.Label closeButton; } } diff --git a/LevelTest/MainForm.cs b/LevelTest/MainForm.cs new file mode 100644 index 0000000..9467f80 --- /dev/null +++ b/LevelTest/MainForm.cs @@ -0,0 +1,49 @@ +using LaptopSimulator2015; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Base; + +namespace LevelTest +{ + public partial class MainForm : Form + { + Minigame level; + public MainForm(Minigame game) + { + level = game; + InitializeComponent(); + minigameClockT.Interval = level.gameClock; + Text = level.name; + level.initGame(minigamePanel, minigameClockT); + } + + private void CloseButton_Click(object sender, EventArgs e) => Application.Exit(); + uint minigameTime; + uint minigamePrevTime; + private void MinigameClockT_Tick(object sender, EventArgs e) + { + minigameTime++; + minigamePanel.Invalidate(); + } + + private void MinigamePanel_Paint(object sender, PaintEventArgs e) + { + using (GraphicsWrapper w = new GraphicsWrapper(e.Graphics, new Rectangle(Point.Empty, minigamePanel.Size))) + { + level.draw(w, minigamePanel, minigameClockT, minigameTime); + if (minigameTime != minigamePrevTime) + { + level.gameTick(w, minigamePanel, minigameClockT, minigameTime); + minigamePrevTime = minigameTime; + } + } + } + } +} diff --git a/lv1_t/MainForm.resx b/LevelTest/MainForm.resx similarity index 100% rename from lv1_t/MainForm.resx rename to LevelTest/MainForm.resx diff --git a/LevelTest/Program.cs b/LevelTest/Program.cs new file mode 100644 index 0000000..50771e1 --- /dev/null +++ b/LevelTest/Program.cs @@ -0,0 +1,65 @@ +using LaptopSimulator2015; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace LevelTest +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + if (args != null && args.Length > 0) + { + if (Directory.Exists(args[0].Replace("\"", ""))) + Directory.SetCurrentDirectory(args[0].Replace("\"", "")); + else if (File.Exists(args[0].Replace("\"", ""))) + Directory.SetCurrentDirectory(Path.GetDirectoryName(args[0].Replace("\"", ""))); + else + throw new Exception("Invalid argument"); + } + else + { + string[] tmp = Directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*.dll", SearchOption.AllDirectories).Where(s => Path.GetFileName(s) != "Base.dll").ToArray(); + if (tmp.Length == 0) + using (FolderBrowserDialog openFileDialog = new FolderBrowserDialog()) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + Directory.SetCurrentDirectory(openFileDialog.SelectedPath); + else + throw new Exception("Please select a folder"); + } + } + Minigame[] levels = Directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*.dll", SearchOption.AllDirectories).Where(s => Path.GetFileName(s) != "Base.dll") + .Select(s => Assembly.LoadFrom(s)).SelectMany(s => s.GetTypes()).Distinct() + .Where(p => typeof(Minigame).IsAssignableFrom(p)).Distinct().Except(new Type[] { typeof(Minigame), typeof(Level), typeof(Goal) }) + .Select(s => (Minigame)Activator.CreateInstance(s)).OrderBy(lv => lv.availableAfter).ToArray(); + Minigame level; + if (levels.Length == 0) + throw new Exception("No Levels found!"); + else if (levels.Length == 1) + level = levels[0]; + else + { + using (ArrayDialog dialog = new ArrayDialog(levels.Select(s => s.name).ToArray())) + { + if (dialog.ShowDialog() == DialogResult.OK) + level = levels[dialog.returnIndex]; + else + throw new Exception("Please select a folder"); + } + } + Application.Run(new MainForm(level)); + } + } +} diff --git a/lv3_t/Properties/AssemblyInfo.cs b/LevelTest/Properties/AssemblyInfo.cs similarity index 90% rename from lv3_t/Properties/AssemblyInfo.cs rename to LevelTest/Properties/AssemblyInfo.cs index 39a7950..70aa219 100644 --- a/lv3_t/Properties/AssemblyInfo.cs +++ b/LevelTest/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("lv3_t")] +[assembly: AssemblyTitle("LevelTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("lv3_t")] +[assembly: AssemblyProduct("LevelTest")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("244e68e6-90d2-447d-b380-13ca8dd3d4ec")] +[assembly: Guid("dfd89655-00a7-4df8-8b2e-17f5befe5090")] // Version information for an assembly consists of the following four values: // diff --git a/lv3g_t/Properties/Resources.Designer.cs b/LevelTest/Properties/Resources.Designer.cs similarity index 94% rename from lv3g_t/Properties/Resources.Designer.cs rename to LevelTest/Properties/Resources.Designer.cs index 2602f4b..b330f8f 100644 --- a/lv3g_t/Properties/Resources.Designer.cs +++ b/LevelTest/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace lv3g_t.Properties +namespace LevelTest.Properties { @@ -43,7 +43,7 @@ namespace lv3g_t.Properties get { if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lv3g_t.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LevelTest.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/lv1_t/Properties/Resources.resx b/LevelTest/Properties/Resources.resx similarity index 100% rename from lv1_t/Properties/Resources.resx rename to LevelTest/Properties/Resources.resx diff --git a/lv1_t/Properties/Settings.Designer.cs b/LevelTest/Properties/Settings.Designer.cs similarity index 97% rename from lv1_t/Properties/Settings.Designer.cs rename to LevelTest/Properties/Settings.Designer.cs index 378699d..f3c781b 100644 --- a/lv1_t/Properties/Settings.Designer.cs +++ b/LevelTest/Properties/Settings.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace SIT.Properties +namespace LevelTest.Properties { diff --git a/lv1_t/Properties/Settings.settings b/LevelTest/Properties/Settings.settings similarity index 100% rename from lv1_t/Properties/Settings.settings rename to LevelTest/Properties/Settings.settings diff --git a/lv1_t/MainForm.Designer.cs b/lv1_t/MainForm.Designer.cs deleted file mode 100644 index a81ad14..0000000 --- a/lv1_t/MainForm.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace SIT -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing & (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.minigamePanel = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.minigamePanel.SuspendLayout(); - this.SuspendLayout(); - // - // minigamePanel - // - this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); - this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.minigamePanel.Location = new System.Drawing.Point(0, 0); - this.minigamePanel.Name = "minigamePanel"; - this.minigamePanel.Size = new System.Drawing.Size(800, 450); - this.minigamePanel.TabIndex = 0; - this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel1_Paint); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 17; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.minigamePanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Form1"; - this.minigamePanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel minigamePanel; - private System.Windows.Forms.Timer minigameClockT; - private System.Windows.Forms.Button button1; - } -} - diff --git a/lv1_t/MainForm.cs b/lv1_t/MainForm.cs deleted file mode 100644 index 18c12d2..0000000 --- a/lv1_t/MainForm.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Threading; -using System.Windows.Forms; -using Base; - -namespace SIT -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime; - uint minigamePrevTime; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - List enemies; - List bullets; - Vector2 player; - double speedMod; - bool enemiesCanShoot; - private void initGame() - { - enemies = new List(); - bullets = new List(); - speedMod = 5; - enemiesCanShoot = true; - player = new Vector2(minigamePanel.Width / 4, minigamePanel.Height / 2); - player.bounds_wrap = true; - player.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10); - } - - private void Panel1_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - g.Clear(Color.Black); - for (int i = 0; i < enemies.Count; i++) - { - g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); - } - for (int i = 0; i < bullets.Count; i++) - { - g.FillRectangle(new SolidBrush(Color.White), new Rectangle(bullets[i].toPoint(), new Size(5, 5))); - } - g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - if (random.Next(0, 100000) < minigameTime + 1300) - enemies.Add(new Vector2(minigamePanel.Width, random.Next(minigamePanel.Height - 10))); - for (int i = 0; i < enemies.Count; i++) - { - enemies[i].X -= 1.2; - if (player.distanceFromSquared(enemies[i]) < 100 | enemies[i].X < 0) - { - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - enemiesCanShoot = enemiesCanShoot | !Input.Action; - List enemiesToRemove = new List(); - List bulletsToRemove = new List(); - for (int i = 0; i < bullets.Count; i++) - { - bullets[i].X += 4; - for (int j = 0; j < enemies.Count; j++) - { - if (bullets[i].distanceFromSquared(enemies[j] + new Vector2(2.5f, 2.5f)) < 56.25f) - { - enemiesToRemove.Add(enemies[j]); - bulletsToRemove.Add(bullets[i]); - } - } - if (bullets[i].X > minigamePanel.Width) - bulletsToRemove.Add(bullets[i]); - } - enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); - bullets = bullets.Except(bulletsToRemove.Distinct()).Distinct().ToList(); - speedMod += 0.1; - speedMod = Math.Max(Math.Min(speedMod, 5), 1); - if (Input.Up) - player.Y -= speedMod; - if (Input.Left) - player.X -= speedMod; - if (Input.Down) - player.Y += speedMod; - if (Input.Right) - player.X += speedMod; - if (Input.Action & enemiesCanShoot) - { - bullets.Add(new Vector2(0, 2.5) + player); - enemiesCanShoot = false; - speedMod--; - } - } - buffer.Render(); - buffer.Dispose(); - } - catch (Exception ex) { - if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") - { - g.Clear(Color.Red); - Drawing.DrawSizedString(g, "Lost.", 20, new PointF(minigamePanel.Width / 2, minigamePanel.Height / 2), Brushes.Black, true); - buffer.Render(); - Thread.Sleep(500); - _initGame(); - } - else -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - } -} diff --git a/lv1_t/Program.cs b/lv1_t/Program.cs deleted file mode 100644 index 9eb6d11..0000000 --- a/lv1_t/Program.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace SIT -{ - static class Program - { - public static bool debug; - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main(string[] args) - { -#if DEBUG - debug = true; -#else - debug = args.Contains("debug"); -#endif - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv1_t/Properties/AssemblyInfo.cs b/lv1_t/Properties/AssemblyInfo.cs deleted file mode 100644 index eb4e314..0000000 --- a/lv1_t/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SIT")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SIT")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d80dbbf2-307f-40a0-86f1-871c8daa394b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/lv1_t/Properties/Resources.Designer.cs b/lv1_t/Properties/Resources.Designer.cs deleted file mode 100644 index ad3857d..0000000 --- a/lv1_t/Properties/Resources.Designer.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SIT.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SIT.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/lv2_t/App.config b/lv2_t/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/lv2_t/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lv2_t/MainForm.Designer.cs b/lv2_t/MainForm.Designer.cs deleted file mode 100644 index 0b4cf2b..0000000 --- a/lv2_t/MainForm.Designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace lv2_t -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.button1 = new System.Windows.Forms.Button(); - this.minigamePanel = new System.Windows.Forms.Panel(); - this.minigamePanel.SuspendLayout(); - this.SuspendLayout(); - // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 17; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // minigamePanel - // - this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); - this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.minigamePanel.Location = new System.Drawing.Point(0, 0); - this.minigamePanel.Name = "minigamePanel"; - this.minigamePanel.Size = new System.Drawing.Size(800, 450); - this.minigamePanel.TabIndex = 1; - this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.MinigamePanel_Paint); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.minigamePanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "MainForm"; - this.minigamePanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Timer minigameClockT; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Panel minigamePanel; - } -} - diff --git a/lv2_t/MainForm.cs b/lv2_t/MainForm.cs deleted file mode 100644 index 57b2868..0000000 --- a/lv2_t/MainForm.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Threading; -using System.Windows.Forms; -using Base; - -namespace lv2_t -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime; - uint minigamePrevTime; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - List enemies; - Vector2 player; - int lives; - private void initGame() - { - enemies = new List(); - player = new Vector2(minigamePanel.Width / 2, minigamePanel.Height / 2); - player.bounds_wrap = true; - player.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10); - lives = 3; - } - - private void MinigamePanel_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - for (int i = 0; i < enemies.Count; i++) - g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(enemies[i].toPoint(), new Size(10, 10))); - g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(player.toPoint(), new Size(10, 10))); - Drawing.DrawSizedString(g, lives.ToString(), 7, (player + new PointF(5, 5)).toPointF(), Brushes.White, true); - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - if (random.Next(0, 100000) < minigameTime + 1300) - { - int tst = random.Next(minigamePanel.Width * 2 + (minigamePanel.Height - 10) * 2); - if (tst <= minigamePanel.Width) - enemies.Add(new Vector2(tst, 0)); - else if (tst <= minigamePanel.Width * 2) - enemies.Add(new Vector2(tst - minigamePanel.Width, minigamePanel.Height - 10)); - else if (tst <= minigamePanel.Width * 2 + minigamePanel.Height - 10) - enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2)); - else - enemies.Add(new Vector2(0, tst - minigamePanel.Width * 2 - minigamePanel.Height + 10)); - } - if (Input.Up) - player.Y -= 5; - if (Input.Left) - player.X -= 5; - if (Input.Down) - player.Y += 5; - if (Input.Right) - player.X += 5; - List enemiesToRemove = new List(); - for (int i = 0; i < enemies.Count; i++) - { - enemies[i].moveTowards(player, Math.Max(6, Math.Sqrt(minigameTime / 100 + 1))); - for (int j = 0; j < enemies.Count; j++) - { - if (i != j && enemies[i].distanceFromSquared(enemies[j]) < 25 && !enemiesToRemove.Contains(enemies[j])) - enemiesToRemove.Add(enemies[i]); - } - if (player.distanceFromSquared(enemies[i]) < 100 && !enemiesToRemove.Contains(enemies[i])) - { - lives--; - enemiesToRemove.Add(enemies[i]); - if (lives <= 0) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList(); - } - buffer.Render(); - buffer.Dispose(); - } - catch (Exception ex) - { - if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") - { - g.Clear(Color.Red); - Drawing.DrawSizedString(g, "Lost.", 20, new PointF(minigamePanel.Width / 2, minigamePanel.Height / 2), Brushes.Black, true); - buffer.Render(); - Thread.Sleep(500); - _initGame(); - } - else -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - } -} diff --git a/lv2_t/MainForm.resx b/lv2_t/MainForm.resx deleted file mode 100644 index 7925979..0000000 --- a/lv2_t/MainForm.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/lv2_t/Program.cs b/lv2_t/Program.cs deleted file mode 100644 index 632d906..0000000 --- a/lv2_t/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv2_t -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv2_t/Properties/AssemblyInfo.cs b/lv2_t/Properties/AssemblyInfo.cs deleted file mode 100644 index 1ccdaf0..0000000 --- a/lv2_t/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("lv2_t")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("lv2_t")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("741ee70e-4ced-40eb-89f2-bd77d41feced")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/lv2_t/Properties/Resources.Designer.cs b/lv2_t/Properties/Resources.Designer.cs deleted file mode 100644 index 6ef38b5..0000000 --- a/lv2_t/Properties/Resources.Designer.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv2_t.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lv2_t.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/lv2_t/Properties/Resources.resx b/lv2_t/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/lv2_t/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/lv2_t/Properties/Settings.Designer.cs b/lv2_t/Properties/Settings.Designer.cs deleted file mode 100644 index a6b335f..0000000 --- a/lv2_t/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv2_t.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get { - return defaultInstance; - } - } - } -} diff --git a/lv2_t/Properties/Settings.settings b/lv2_t/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/lv2_t/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lv2_t/lv2_t.csproj b/lv2_t/lv2_t.csproj deleted file mode 100644 index 771e082..0000000 --- a/lv2_t/lv2_t.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {741EE70E-4CED-40EB-89F2-BD77D41FECED} - WinExe - lv2_t - lv2_t - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} - Base - - - - \ No newline at end of file diff --git a/lv3_t/App.config b/lv3_t/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/lv3_t/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lv3_t/MainForm.Designer.cs b/lv3_t/MainForm.Designer.cs deleted file mode 100644 index f8115e9..0000000 --- a/lv3_t/MainForm.Designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace lv3_t -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.button1 = new System.Windows.Forms.Button(); - this.minigamePanel = new System.Windows.Forms.Panel(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.minigamePanel.SuspendLayout(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // minigamePanel - // - this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); - this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.minigamePanel.Location = new System.Drawing.Point(0, 0); - this.minigamePanel.Name = "minigamePanel"; - this.minigamePanel.Size = new System.Drawing.Size(800, 450); - this.minigamePanel.TabIndex = 1; - this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.MinigamePanel_Paint); - // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 17; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.minigamePanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Form1"; - this.minigamePanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Panel minigamePanel; - private System.Windows.Forms.Timer minigameClockT; - } -} - diff --git a/lv3_t/MainForm.cs b/lv3_t/MainForm.cs deleted file mode 100644 index ac815a0..0000000 --- a/lv3_t/MainForm.cs +++ /dev/null @@ -1,166 +0,0 @@ -using Base; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv3_t -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime; - uint minigamePrevTime; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - Vector2 center; - Vector2 cannon; - Vector2 targ; - List targets; - Rectangle player => new Rectangle(center.toPoint().X - 5, center.toPoint().Y - 5, 10, 10); - double playerRot; - double cannonL; - double power; - bool firing; - uint lastTarget; - private void initGame() - { - center = new Vector2(minigamePanel.Width / 2, minigamePanel.Height / 2); - cannon = new Vector2(center); - targ = new Vector2(center); - targets = new List(); - playerRot = 0; - cannonL = 30; - power = 10; - firing = false; - lastTarget = 0; - } - private void MinigamePanel_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - g.Clear(Color.Black); - g.FillRectangle(new SolidBrush(Color.Green), player); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 5), center.toPoint(), cannon.toPoint()); - for (int i = 0; i < targets.Count; i++) - { - g.DrawEllipse(new Pen(new SolidBrush(Color.Red), 6), new RectangleF(Misc.d2f(targets[i].X - 10), Misc.d2f(targets[i].Y - 10), 20, 20)); - g.DrawEllipse(new Pen(new SolidBrush(Color.White), 6), new RectangleF(Misc.d2f(targets[i].X - 7), Misc.d2f(targets[i].Y - 7), 14, 14)); - g.FillEllipse(new SolidBrush(Color.Red), new RectangleF(Misc.d2f(targets[i].X - 3), Misc.d2f(targets[i].Y - 3), 6, 6)); - g.DrawLine(new Pen(new SolidBrush(Color.Gray), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + 13), Misc.d2f(targets[i].Y - 15)); - g.DrawLine(new Pen(new SolidBrush(Color.Red), 3), Misc.d2f(targets[i].X - 13), Misc.d2f(targets[i].Y - 15), Misc.d2f(targets[i].X + ((((double)targets[i].Tag) * 0.2) - 12.9) + 0.1), Misc.d2f(targets[i].Y - 15)); - } - if (firing) - { - g.DrawRectangle(new Pen(new SolidBrush(Color.Green), 1), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y - power / 2)), new PointF(Misc.d2i(targ.X), Misc.d2i(targ.Y + power / 2))); - g.DrawLine(new Pen(new SolidBrush(Color.Green), 1), new PointF(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y)), new PointF(Misc.d2i(targ.X + power / 2), Misc.d2i(targ.Y))); - } - else - { - g.FillRectangle(new SolidBrush(Color.Green), new RectangleF(Misc.d2f(targ.X - 2.5f), Misc.d2f(targ.Y - 2.5f), 5, 5)); - } - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - if (minigameTime - lastTarget > 90 + 40 / (minigameTime / 100 + 1)) - { - targets.Add(new Vector2(random.Next(minigamePanel.Height + 25) + (minigamePanel.Width - minigamePanel.Height - 50) / 2, random.Next(minigamePanel.Height))); - targets[targets.Count - 1].Tag = (double)130; - lastTarget = minigameTime; - } - cannon = new Vector2(center); - cannon.moveInDirection(Misc.deg2rad(playerRot), 20); - if (Input.Action) - { - firing = true; - power = Math.Min(power + 5, 100); - } - else - if (firing) - { - firing = false; - List targetsToRemove = new List(); - for (int i = 0; i < targets.Count; i++) - { - if (targets[i].distanceFromSquared(targ) <= Math.Pow(power + 10, 2)) - targetsToRemove.Add(targets[i]); - } - targets = targets.Except(targetsToRemove.Distinct()).Distinct().ToList(); - g.FillRectangle(new SolidBrush(Color.White), new Rectangle(Misc.d2i(targ.X - power / 2), Misc.d2i(targ.Y - power / 2), Misc.d2i(power), Misc.d2i(power))); - power = 10; - } - targ = new Vector2(center); - targ.Tag = playerRot; - if (Input.Up) - cannonL += 100 / power; - if (Input.Down) - cannonL -= 100 / power; - if (Input.Right) - playerRot += 80 / power; - if (Input.Left) - playerRot -= 80 / power; - while (playerRot > 360) - playerRot -= 360; - while (playerRot < 0) - playerRot += 360; - cannonL = Math.Max(Math.Min(cannonL, minigamePanel.Height / 2), 22.5f); - targ.moveInDirection(Misc.deg2rad((double)targ.Tag), cannonL); - for (int i = 0; i < targets.Count; i++) - { - targets[i].Tag = ((double)targets[i].Tag) - 1; - if ((double)targets[i].Tag <= 0) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - buffer.Render(); - buffer.Dispose(); - } - catch (Exception ex) - { - if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") - { - g.Clear(Color.Red); - Drawing.DrawSizedString(g, "Lost.", 20, new PointF(minigamePanel.Width / 2, minigamePanel.Height / 2), Brushes.Black, true); - buffer.Render(); - Thread.Sleep(500); - _initGame(); - } - else -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - } -} diff --git a/lv3_t/MainForm.resx b/lv3_t/MainForm.resx deleted file mode 100644 index 7925979..0000000 --- a/lv3_t/MainForm.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/lv3_t/Program.cs b/lv3_t/Program.cs deleted file mode 100644 index d5db6ae..0000000 --- a/lv3_t/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv3_t -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv3_t/Properties/Resources.Designer.cs b/lv3_t/Properties/Resources.Designer.cs deleted file mode 100644 index d932b28..0000000 --- a/lv3_t/Properties/Resources.Designer.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv3_t.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lv3_t.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/lv3_t/Properties/Resources.resx b/lv3_t/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/lv3_t/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/lv3_t/Properties/Settings.Designer.cs b/lv3_t/Properties/Settings.Designer.cs deleted file mode 100644 index 9dd0c2a..0000000 --- a/lv3_t/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv3_t.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get { - return defaultInstance; - } - } - } -} diff --git a/lv3_t/Properties/Settings.settings b/lv3_t/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/lv3_t/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lv3_t/lv3_t.csproj b/lv3_t/lv3_t.csproj deleted file mode 100644 index 9781207..0000000 --- a/lv3_t/lv3_t.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {244E68E6-90D2-447D-B380-13CA8DD3D4EC} - WinExe - lv3_t - lv3_t - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} - Base - - - - \ No newline at end of file diff --git a/lv3g_t/App.config b/lv3g_t/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/lv3g_t/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lv3g_t/MainForm.Designer.cs b/lv3g_t/MainForm.Designer.cs deleted file mode 100644 index 81c86b5..0000000 --- a/lv3g_t/MainForm.Designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -namespace lv3g_t -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.button1 = new System.Windows.Forms.Button(); - this.minigamePanel = new System.Windows.Forms.Panel(); - this.minigamePanel.SuspendLayout(); - this.SuspendLayout(); - // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 300; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // minigamePanel - // - this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); - this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.minigamePanel.Location = new System.Drawing.Point(0, 0); - this.minigamePanel.Name = "minigamePanel"; - this.minigamePanel.Size = new System.Drawing.Size(800, 450); - this.minigamePanel.TabIndex = 2; - this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.MinigamePanel_Paint); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.minigamePanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Form1"; - this.minigamePanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Timer minigameClockT; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Panel minigamePanel; - } -} - diff --git a/lv3g_t/MainForm.cs b/lv3g_t/MainForm.cs deleted file mode 100644 index 7e9db22..0000000 --- a/lv3g_t/MainForm.cs +++ /dev/null @@ -1,467 +0,0 @@ -using Base; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv3g_t -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime; - uint minigamePrevTime; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - public static int[,] grid = new int[23, 10]; - public static int[,] droppedtetrominoeLocationGrid = new int[23, 10]; - public static bool isDropped = false; - static Tetrominoe tet; - static Tetrominoe nexttet; - public static int linesCleared = 0, score = 0, level = 1; - public static Random rnd; - private void initGame() - { - rnd = new Random(); - grid = new int[23, 10]; - droppedtetrominoeLocationGrid = new int[23, 10]; - isDropped = false; - linesCleared = 0; - score = 0; - level = 1; - nexttet = new Tetrominoe(); - tet = nexttet; - tet.Spawn(); - nexttet = new Tetrominoe(); - } - - private void MinigamePanel_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - g.Clear(Color.Black); - for (int y = 0; y < 23; ++y) - { - for (int x = 0; x < 10; x++) - { - if (grid[y, x] == 1 | droppedtetrominoeLocationGrid[y, x] == 1) - g.FillRectangle(Brushes.White, new Rectangle(x * 10, y * 10, 10, 10)); - } - g.DrawLine(new Pen(Color.DarkGray), new Point(0, (y + 1) * 10), new Point(10 * 10, (y + 1) * 10)); - } - for (int x = 0; x < 10; x++) - { - g.DrawLine(new Pen(Color.DarkGray), new Point((x + 1) * 10, 0), new Point((x + 1) * 10, 23 * 10)); - } - Drawing.DrawSizedString(g, "Level " + level, 10, new PointF(150, 10), Brushes.White); - Drawing.DrawSizedString(g, "Score " + score, 10, new PointF(150, 30), Brushes.White); - Drawing.DrawSizedString(g, "LinesCleared " + linesCleared, 10, new PointF(150, 50), Brushes.White); - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - tet.Drop(); - if (isDropped == true) - { - tet = nexttet; - nexttet = new Tetrominoe(); - tet.Spawn(); - isDropped = false; - score += 10; - } - int j; for (j = 0; j < 10; j++) - { - if (droppedtetrominoeLocationGrid[0, j] == 1) - _initGame(); - } - Input(); - ClearBlock(); - } - buffer.Render(); - } - catch (Exception ex) - { -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - - private static void ClearBlock() - { - int combo = 0; - for (int i = 0; i < 23; i++) - { - int j; for (j = 0; j < 10; j++) - { - if (droppedtetrominoeLocationGrid[i, j] == 0) - break; - } - if (j == 10) - { - linesCleared++; - combo++; - Console.Beep(400, 200); - for (j = 0; j < 10; j++) - { - droppedtetrominoeLocationGrid[i, j] = 0; - } - int[,] newdroppedtetrominoeLocationGrid = new int[23, 10]; - for (int k = 1; k < i; k++) - { - for (int l = 0; l < 10; l++) - { - newdroppedtetrominoeLocationGrid[k + 1, l] = droppedtetrominoeLocationGrid[k, l]; - } - } - for (int k = 1; k < i; k++) - { - for (int l = 0; l < 10; l++) - { - droppedtetrominoeLocationGrid[k, l] = 0; - } - } - for (int k = 0; k < 23; k++) - for (int l = 0; l < 10; l++) - if (newdroppedtetrominoeLocationGrid[k, l] == 1) - droppedtetrominoeLocationGrid[k, l] = 1; - } - } - score += (int)Math.Round(Math.Sqrt(Math.Max(combo * 50 - 50, 0)) * 5); - level = (int)Math.Round(Math.Sqrt(score * 0.01)) + 1; - } - private static void Input() - { - if (Base.Input.Left & !tet.isSomethingLeft()) - { - for (int i = 0; i < 4; i++) - tet.location[i][1] -= 1; - tet.Update(); - } - else if (Base.Input.Right & !tet.isSomethingRight()) - { - for (int i = 0; i < 4; i++) - tet.location[i][1] += 1; - tet.Update(); - } - if (Base.Input.Down) - tet.Drop(); - if (Base.Input.Up) - for (; tet.isSomethingBelow() != true;) - tet.Drop(); - if (Base.Input.Action) - { - tet.Rotate(); - tet.Update(); - } - } - - public class Tetrominoe - { - public static int[,] I = new int[1, 4] { { 1, 1, 1, 1 } }; - - public static int[,] O = new int[2, 2] { { 1, 1 }, - { 1, 1 } }; - - public static int[,] T = new int[2, 3] { { 0, 1, 0 }, - { 1, 1, 1 } }; - - public static int[,] S = new int[2, 3] { { 0, 1, 1 }, - { 1, 1, 0 } }; - - public static int[,] Z = new int[2, 3] { { 1, 1, 0 }, - { 0, 1, 1 } }; - - public static int[,] J = new int[2, 3] { { 1, 0, 0 }, - { 1, 1, 1 } }; - - public static int[,] L = new int[2, 3] { { 0, 0, 1 }, - { 1, 1, 1 } }; - public static List tetrominoes = new List() { I, O, T, S, Z, J, L }; - private readonly int[,] shape; - public List location = new List(); - public Tetrominoe() - { - shape = tetrominoes[rnd.Next(0, tetrominoes.Count)]; - } - public void Spawn() - { - for (int i = 0; i < shape.GetLength(0); i++) - { - for (int j = 0; j < shape.GetLength(1); j++) - { - if (shape[i, j] == 1) - { - location.Add(new int[] { i, (10 - shape.GetLength(1)) / 2 + j }); - } - } - } - Update(); - } - public void Drop() - { - if (isSomethingBelow()) - { - for (int i = 0; i < 4; i++) - { - droppedtetrominoeLocationGrid[location[i][0], location[i][1]] = 1; - } - isDropped = true; - Console.Beep(800, 200); - } - else - { - for (int numCount = 0; numCount < 4; numCount++) - { - location[numCount][0] += 1; - } - Update(); - } - } - public void Rotate() - { - List templocation = new List(); - for (int i = 0; i < shape.GetLength(0); i++) - { - for (int j = 0; j < shape.GetLength(1); j++) - { - if (shape[i, j] == 1) - { - templocation.Add(new int[] { i, (10 - shape.GetLength(1)) / 2 + j }); - } - } - } - if (shape == tetrominoes[0]) - { - for (int i = 0; i < location.Count; i++) - { - templocation[i] = TransformMatrix(location[i], location[2]); - } - } - else if (shape == tetrominoes[3]) - { - for (int i = 0; i < location.Count; i++) - { - templocation[i] = TransformMatrix(location[i], location[3]); - } - } - else if (shape == tetrominoes[1]) - return; - else - { - for (int i = 0; i < location.Count; i++) - { - templocation[i] = TransformMatrix(location[i], location[2]); - } - } - for (int count = 0; isOverlayLeft(templocation) != false | isOverlayRight(templocation) != false | isOverlayBelow(templocation) != false; count++) - { - if (isOverlayLeft(templocation) == true) - { - for (int i = 0; i < location.Count; i++) - { - templocation[i][1] += 1; - } - } - if (isOverlayRight(templocation) == true) - { - for (int i = 0; i < location.Count; i++) - { - templocation[i][1] -= 1; - } - } - if (isOverlayBelow(templocation) == true) - { - for (int i = 0; i < location.Count; i++) - { - templocation[i][0] -= 1; - } - } - if (count == 3) - { - return; - } - } - location = templocation; - } - public bool notFalse(bool? inp) => (inp ?? true); - public int[] TransformMatrix(int[] coord, int[] axis) => new int[] { axis[0] - axis[1] + coord[1], axis[0] + axis[1] - coord[0] }; - public bool isSomethingBelow() - { - for (int i = 0; i < 4; i++) - { - if (location[i][0] + 1 >= 23) - return true; - if (location[i][0] + 1 < 23 & droppedtetrominoeLocationGrid[location[i][0] + 1, location[i][1]] == 1) - return true; - } - return false; - } - public bool? isOverlayBelow(List location) - { - List ycoords = new List(); - for (int i = 0; i < 4; i++) - { - ycoords.Add(location[i][0]); - if (location[i][0] >= 23) - return true; - if (location[i][0] < 0 | location[i][1] < 0 | location[i][1] > 9) - return null; - } - for (int i = 0; i < 4; i++) - { - if (ycoords.Max() - ycoords.Min() == 3) - { - if ((ycoords.Max() == location[i][0] | ycoords.Max() - 1 == location[i][0]) & (droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1)) - { - return true; - } - } - else - { - if ((ycoords.Max() == location[i][0]) & (droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1)) - { - return true; - } - } - } - return false; - } - public bool isSomethingLeft() - { - for (int i = 0; i < 4; i++) - { - if (location[i][1] == 0) - return true; - else if (droppedtetrominoeLocationGrid[location[i][0], location[i][1] - 1] == 1) - return true; - } - return false; - } - public bool? isOverlayLeft(List location) - { - List xcoords = new List(); - for (int i = 0; i < 4; i++) - { - xcoords.Add(location[i][1]); - if (location[i][1] < 0) - return true; - if (location[i][1] > 9) - return false; - if (location[i][0] >= 23 | location[i][0] < 0) - return null; - } - for (int i = 0; i < 4; i++) - { - if (xcoords.Max() - xcoords.Min() == 3) - { - if (xcoords.Min() == location[i][1] | xcoords.Min() + 1 == location[i][1]) - { - if (droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1) - { - return true; - } - } - } - else - { - if (xcoords.Min() == location[i][1]) - { - if (droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1) - { - return true; - } - } - } - } - return false; - } - public bool isSomethingRight() - { - for (int i = 0; i < 4; i++) - { - if (location[i][1] == 9) - return true; - else if (droppedtetrominoeLocationGrid[location[i][0], location[i][1] + 1] == 1) - return true; - } - return false; - } - public bool? isOverlayRight(List location) - { - List xcoords = new List(); - for (int i = 0; i < 4; i++) - { - xcoords.Add(location[i][1]); - if (location[i][1] > 9) - return true; - if (location[i][1] < 0) - return false; - if (location[i][0] >= 23 | location[i][0] < 0) - return null; - } - for (int i = 0; i < 4; i++) - { - if (xcoords.Max() - xcoords.Min() == 3) - { - if ((xcoords.Max() == location[i][1] | xcoords.Max() - 1 == location[i][1]) & droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1) - { - return true; - } - } - else - { - if (xcoords.Max() == location[i][1] & droppedtetrominoeLocationGrid[location[i][0], location[i][1]] == 1) - { - return true; - } - } - } - return false; - } - public void Update() - { - for (int i = 0; i < 23; i++) - { - for (int j = 0; j < 10; j++) - { - grid[i, j] = 0; - } - } - for (int i = 0; i < 4; i++) - { - grid[location[i][0], location[i][1]] = 1; - } - } - } - } -} diff --git a/lv3g_t/Program.cs b/lv3g_t/Program.cs deleted file mode 100644 index 344411b..0000000 --- a/lv3g_t/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv3g_t -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv3g_t/Properties/AssemblyInfo.cs b/lv3g_t/Properties/AssemblyInfo.cs deleted file mode 100644 index d91711e..0000000 --- a/lv3g_t/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("lv3g_t")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("lv3g_t")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e6bf80e0-8848-4a6f-b114-fec5055e1d9e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/lv3g_t/Properties/Resources.resx b/lv3g_t/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/lv3g_t/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/lv3g_t/Properties/Settings.Designer.cs b/lv3g_t/Properties/Settings.Designer.cs deleted file mode 100644 index 58dced3..0000000 --- a/lv3g_t/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv3g_t.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get { - return defaultInstance; - } - } - } -} diff --git a/lv3g_t/Properties/Settings.settings b/lv3g_t/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/lv3g_t/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lv3g_t/lv3g_t.csproj b/lv3g_t/lv3g_t.csproj deleted file mode 100644 index 6215dc6..0000000 --- a/lv3g_t/lv3g_t.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {E6BF80E0-8848-4A6F-B114-FEC5055E1D9E} - WinExe - lv3g_t - lv3g_t - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {9A9561A7-DD5F-43A5-A3F5-A95F35DA204D} - Base - - - - \ No newline at end of file diff --git a/lv4_t/App.config b/lv4_t/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/lv4_t/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lv4_t/MainForm.cs b/lv4_t/MainForm.cs deleted file mode 100644 index 2690762..0000000 --- a/lv4_t/MainForm.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Threading; -using System.Windows.Forms; -using Base; - -namespace lv4_t -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime = 0; - uint minigamePrevTime = 0; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - Random rnd; - Vector2 player; - Vector2 playerV; - double lazor; - double lazorTime; - double speed; - int jmpj; - bool wasOnPlatform; - List platforms; - private void initGame() - { - rnd = new Random(); - playerV = new Vector2(); - playerV.bounds = new Rectangle(-10, -20, 20, 40); - playerV.bounds_wrap = false; - platforms = new List(); - for (int i = 0; i < 5; i++) - for (int j = 0; j < 2; j++) - { - platforms.Add(new Vector2(rnd.Next(minigamePanel.Width - 100) + 50, i * (minigamePanel.Height / 5))); - } - player = new Vector2(platforms[platforms.Count / 2].X, -10); - player.bounds = new Rectangle(-5, 0, minigamePanel.Width + 10, 0); - player.bounds_wrap = true; - lazor = player.X; - lazorTime = 100; - speed = 1; - wasOnPlatform = true; - } - private void MinigamePanel_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - g.Clear(Color.Black); - g.FillRectangle(new SolidBrush(Color.Green), player2rect()); - if (lazorTime >= 0 && lazorTime <= 80) - { - g.FillRectangle(new SolidBrush(Color.DarkGray), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height)); - g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 1, 0, 2, minigamePanel.Height - (float)Misc.map(0, 80, 0, minigamePanel.Height, lazorTime))); - } - for (int i = 0; i < platforms.Count; i++) - g.FillRectangle(new SolidBrush(Color.White), plat2rect(i)); - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - speed = Math.Min(minigameTime / 200d, 2) + 0.5; - lazorTime -= Math.Min(minigameTime / 800, 2.5) + 0.5; - minigamePrevTime = minigameTime; - if (lazorTime <= 0) - { - g.FillRectangle(new SolidBrush(Color.Red), new RectangleF((float)lazor - 5, 0, 10, minigamePanel.Height)); - if (lazorTime <= -2) - { - lazorTime = 100; - lazor = player.X; - } - else - { - if (player.X > lazor - 10 && player.X < lazor + 10) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - } - } - player.Y += speed; - for (int i = 0; i < platforms.Count; i++) - { - platforms[i].Y += speed; - if (platforms[i].Y > minigamePanel.Height) - { - platforms[i].Y = 0; - platforms[i].X = rnd.Next(minigamePanel.Width); - } - } - double movementFactor; - if (wasOnPlatform) - { - movementFactor = 2; - playerV.X *= 0.7; - playerV.Y = Math.Min(playerV.Y, 0); - } - else - { - movementFactor = 5; - playerV.X *= 0.9; - playerV.Y += 1; - } - if (Input.Up) - { - if (wasOnPlatform || jmpj > 0) - { - playerV.Y -= jmpj / 6d + 1.5; - jmpj--; - } - } - else - { - if (wasOnPlatform) - jmpj = 10; - else - jmpj = 0; - } - jmpj = Math.Max(0, jmpj); - if (Input.Left) - playerV.X -= movementFactor; - if (Input.Right) - playerV.X += movementFactor; - player.X += playerV.X; - if (playerV.Y < 0) - player.Y += playerV.Y; - else - for (int i = 0; i < playerV.Y / 2; i++) - { - if (onPlatform) - break; - player.Y += 2; - } - if (player.Y > minigamePanel.Height) - throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe")); - wasOnPlatform = onPlatform; - } - buffer.Render(); - buffer.Dispose(); - } - catch (Exception ex) - { - if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") - { - g.Clear(Color.Red); - Drawing.DrawSizedString(g, "Lost.", 20, new PointF(minigamePanel.Width / 2, minigamePanel.Height / 2), Brushes.Black, true); - buffer.Render(); - Thread.Sleep(500); - _initGame(); - } - else -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - bool onPlatform - { - get { - for (int i = 0; i < platforms.Count; i++) - { - RectangleF rect = plat2rect(i); - if (player.X < rect.X) - { - if (player.Y < rect.Y) - platforms[i].Tag = (player - new PointF(rect.X, rect.Y)).magnitude; - else if (player.Y > rect.Y + rect.Height) - platforms[i].Tag = (player - new PointF(rect.X, rect.Y + rect.Height)).magnitude; - else - platforms[i].Tag = rect.X - player.X; - } - else if (player.X > rect.X + rect.Width) - { - if (player.Y < rect.Y) - platforms[i].Tag = (player - new PointF(rect.X + rect.Width, rect.Y)).magnitude; - else if (player.Y > rect.Y + rect.Height) - platforms[i].Tag = (player - new PointF(rect.X + rect.Width, rect.Y + rect.Height)).magnitude; - else - platforms[i].Tag = player.X - rect.X + rect.Width; - } - else - { - if (player.Y < rect.Y) - platforms[i].Tag = rect.Y - player.Y; - else if (player.Y > rect.Y + rect.Height) - platforms[i].Tag = player.Y - (rect.Y + rect.Height); - else - platforms[i].Tag = 0d; - } - if (((double)platforms[i].Tag) <= 20 && RectangleF.Intersect(player2rect(), rect) != RectangleF.Empty && player.Y < platforms[i].Y - 8) - return true; - } - return false; - } - } - RectangleF plat2rect(int platform) => new RectangleF((platforms[platform] - new Vector2(50, 5)).toPointF(), new SizeF(100, 10)); - RectangleF player2rect() => new RectangleF((player - new Vector2(5, 5)).toPointF(), new SizeF(10, 10)); - } -} diff --git a/lv4_t/MainForm.resx b/lv4_t/MainForm.resx deleted file mode 100644 index 7925979..0000000 --- a/lv4_t/MainForm.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/lv4_t/Program.cs b/lv4_t/Program.cs deleted file mode 100644 index 743756f..0000000 --- a/lv4_t/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv4_t -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv4_t/Properties/AssemblyInfo.cs b/lv4_t/Properties/AssemblyInfo.cs deleted file mode 100644 index d0b0db0..0000000 --- a/lv4_t/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("lv4_t")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("lv4_t")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("22d618c0-f0a4-417f-a815-c760bf4376b2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/lv4_t/Properties/Resources.Designer.cs b/lv4_t/Properties/Resources.Designer.cs deleted file mode 100644 index cc37acf..0000000 --- a/lv4_t/Properties/Resources.Designer.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv4_t.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lv4_t.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/lv4_t/Properties/Resources.resx b/lv4_t/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/lv4_t/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/lv4_t/Properties/Settings.Designer.cs b/lv4_t/Properties/Settings.Designer.cs deleted file mode 100644 index fee6974..0000000 --- a/lv4_t/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv4_t.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get { - return defaultInstance; - } - } - } -} diff --git a/lv4_t/Properties/Settings.settings b/lv4_t/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/lv4_t/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lv4_t/lv4_t.csproj b/lv4_t/lv4_t.csproj deleted file mode 100644 index ae5959d..0000000 --- a/lv4_t/lv4_t.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {22D618C0-F0A4-417F-A815-C760BF4376B2} - WinExe - lv4_t - lv4_t - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} - Base - - - - \ No newline at end of file diff --git a/lv_tst_base/App.config b/lv_tst_base/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/lv_tst_base/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lv_tst_base/MainForm.Designer.cs b/lv_tst_base/MainForm.Designer.cs deleted file mode 100644 index edf064d..0000000 --- a/lv_tst_base/MainForm.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace lv_tst_base -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing & (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.minigamePanel = new System.Windows.Forms.Panel(); - this.button1 = new System.Windows.Forms.Button(); - this.minigameClockT = new System.Windows.Forms.Timer(this.components); - this.minigamePanel.SuspendLayout(); - this.SuspendLayout(); - // - // minigamePanel - // - this.minigamePanel.BackColor = System.Drawing.Color.Black; - this.minigamePanel.Controls.Add(this.button1); - this.minigamePanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.minigamePanel.Location = new System.Drawing.Point(0, 0); - this.minigamePanel.Name = "minigamePanel"; - this.minigamePanel.Size = new System.Drawing.Size(800, 450); - this.minigamePanel.TabIndex = 0; - this.minigamePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.MinigamePanel_Paint); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(777, 0); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(23, 23); - this.button1.TabIndex = 0; - this.button1.TabStop = false; - this.button1.Text = "X"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.Button1_Click); - // - // minigameClockT - // - this.minigameClockT.Enabled = true; - this.minigameClockT.Interval = 17; - this.minigameClockT.Tick += new System.EventHandler(this.MinigameClockT_Tick); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.minigamePanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Form1"; - this.minigamePanel.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel minigamePanel; - private System.Windows.Forms.Timer minigameClockT; - private System.Windows.Forms.Button button1; - } -} - diff --git a/lv_tst_base/MainForm.cs b/lv_tst_base/MainForm.cs deleted file mode 100644 index bee335e..0000000 --- a/lv_tst_base/MainForm.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Threading; -using System.Windows.Forms; -using Base; - -namespace lv_tst_base -{ - public partial class MainForm : Form - { - #region FRMBD - uint minigameTime; - uint minigamePrevTime; - public MainForm() - { - InitializeComponent(); - _initGame(); - } - - private void Button1_Click(object sender, EventArgs e) => Application.Exit(); - private void MinigameClockT_Tick(object sender, EventArgs e) - { - minigameTime++; - minigamePanel.Invalidate(); - } - - private void _initGame() - { - minigameTime = 0; - minigamePrevTime = 0; - initGame(); - } - #endregion - private void initGame() - { - - } - - private void MinigamePanel_Paint(object sender, PaintEventArgs e) - { - BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate(e.Graphics, new Rectangle(0, 0, minigamePanel.Width, minigamePanel.Height)); - Graphics g = buffer.Graphics; - try - { - g.Clear(Color.Black); - //Draw Sprites - Random random = new Random(); - if (minigameTime != minigamePrevTime) - { - minigamePrevTime = minigameTime; - //Game Logic - } - buffer.Render(); - } - catch (Exception ex) - { - if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") - { - g.Clear(Color.Red); - Drawing.DrawSizedString(g, "Lost.", 20, new PointF(minigamePanel.Width / 2, minigamePanel.Height / 2), Brushes.Black, true); - buffer.Render(); - Thread.Sleep(500); - _initGame(); - } - else -#if DEBUG - throw; -#else - Console.WriteLine(ex.ToString()); -#endif - } - } - } -} \ No newline at end of file diff --git a/lv_tst_base/MainForm.resx b/lv_tst_base/MainForm.resx deleted file mode 100644 index 7925979..0000000 --- a/lv_tst_base/MainForm.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/lv_tst_base/Program.cs b/lv_tst_base/Program.cs deleted file mode 100644 index f44901d..0000000 --- a/lv_tst_base/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace lv_tst_base -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/lv_tst_base/Properties/AssemblyInfo.cs b/lv_tst_base/Properties/AssemblyInfo.cs deleted file mode 100644 index ff63467..0000000 --- a/lv_tst_base/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("lv_tst_base")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("lv_tst_base")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("52ce6beb-ec81-4a14-85dd-3f8db8e33202")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/lv_tst_base/Properties/Resources.Designer.cs b/lv_tst_base/Properties/Resources.Designer.cs deleted file mode 100644 index 3ecf813..0000000 --- a/lv_tst_base/Properties/Resources.Designer.cs +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv_tst_base.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lv_tst_base.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/lv_tst_base/Properties/Resources.resx b/lv_tst_base/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/lv_tst_base/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/lv_tst_base/Properties/Settings.Designer.cs b/lv_tst_base/Properties/Settings.Designer.cs deleted file mode 100644 index a389e20..0000000 --- a/lv_tst_base/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace lv_tst_base.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get { - return defaultInstance; - } - } - } -} diff --git a/lv_tst_base/Properties/Settings.settings b/lv_tst_base/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/lv_tst_base/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/lv_tst_base/lv_tst_base.csproj b/lv_tst_base/lv_tst_base.csproj deleted file mode 100644 index 23d3e56..0000000 --- a/lv_tst_base/lv_tst_base.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {52CE6BEB-EC81-4A14-85DD-3F8DB8E33202} - WinExe - lv_tst_base - lv_tst_base - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - {9a9561a7-dd5f-43a5-a3f5-a95f35da204d} - Base - - - - \ No newline at end of file