Quick Graphics Wrapper, moved Level testing to singular Binary

This commit is contained in:
CreepyCrafter24 2019-09-26 20:44:45 +02:00
parent 9645a01445
commit 8549ee0da8
79 changed files with 595 additions and 4467 deletions

109
1/1.cs
View File

@ -60,7 +60,6 @@ namespace LaptopSimulator2015.Levels
public Panel desktopIcon { get; set; }
public int installerProgressSteps => 500;
uint minigamePrevTime = 0;
List<Vector2> enemies;
List<Vector2> 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<Vector2> enemiesToRemove = new List<Vector2>();
List<Vector2> bulletsToRemove = new List<Vector2>();
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<Vector2> enemiesToRemove = new List<Vector2>();
List<Vector2> bulletsToRemove = new List<Vector2>();
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<Vector2>();
bullets = new List<Vector2>();
@ -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)));
}
}
}

97
2/2.cs
View File

@ -61,72 +61,59 @@ namespace LaptopSimulator2015.Levels
public Panel desktopIcon { get; set; }
public int installerProgressSteps => 500;
uint minigamePrevTime = 0;
List<Vector2> 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<Vector2> enemiesToRemove = new List<Vector2>();
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<Vector2> enemiesToRemove = new List<Vector2>();
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<Vector2>();
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);
}
}
}

141
3/3.cs
View File

@ -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<Vector2> targetsToRemove = new List<Vector2>();
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<Vector2> targetsToRemove = new List<Vector2>();
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));
}
}
}
}

81
3g/3.cs
View File

@ -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 } };

165
4/4.cs
View File

@ -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<Vector2> 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));
}
}
}

View File

@ -8,18 +8,30 @@ using System.Threading.Tasks;
namespace Base
{
public static class Drawing
public class GraphicsWrapper : IDisposable
{
BufferedGraphics _g;
public readonly Graphics g;
/// <summary>
/// Wrap the Graphics object with these excellent High-Quality functions
/// </summary>
/// <param name="g">The Graphics-object to wrap</param>
/// <param name="targetSize">The size of the device the Graphics are drawn to</param>
public GraphicsWrapper(Graphics g, Rectangle targetSize)
{
_g = BufferedGraphicsManager.Current.Allocate(g ?? throw new ArgumentNullException(nameof(g)), targetSize);
this.g = _g.Graphics;
}
/// <summary>
/// Draw a string with the given size
/// </summary>
/// <param name="g">The graphics object to draw the string on</param>
/// <param name="s">The string to draw</param>
/// <param name="size">The font size of the string</param>
/// <param name="location">The location to draw the string at</param>
/// <param name="brush">The brush to draw the string with</param>
/// <param name="isLocationCentered">Set to true if you want to draw the string around instead of left-down from the location</param>
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();
}
}
}

View File

@ -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
/// <param name="g">A temporary Graphics object, should not be used</param>
/// <param name="minigamePanel">The panel on which the minigame is displayed</param>
/// <param name="minigameTimer">The timer used for scheduling frames</param>
void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer);
void initGame(Panel minigamePanel, Timer minigameTimer);
/// <summary>
/// Called each frame
/// Called physics frame
/// </summary>
/// <param name="g">Graphics object, to be used for drawing the scene</param>
/// <param name="minigamePanel">The panel on which the minigame is displayed</param>
/// <param name="minigameTimer">The timer used for scheduling frames</param>
/// <param name="minigameTime">The amount of total displayed frames</param>
void gameTick(Graphics g, Panel minigamePanel, Timer minigameTimer, uint minigameTime);
void gameTick(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime);
/// <summary>
/// Called graphics frame
/// </summary>
/// <param name="g">Graphics object, to be used for drawing the scene</param>
/// <param name="minigamePanel">The panel on which the minigame is displayed</param>
/// <param name="minigameTimer">The timer used for scheduling frames</param>
/// <param name="minigameTime">The amount of total displayed frames</param>
void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime);
}
public interface Level : Minigame
{

View File

@ -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}

View File

@ -107,8 +107,7 @@ namespace LaptopSimulator2015
IEnumerable<Type> 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)
{

66
LevelTest/ArrayDialog.Designer.cs generated Normal file
View File

@ -0,0 +1,66 @@
namespace LevelTest
{
partial class ArrayDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

31
LevelTest/ArrayDialog.cs Normal file
View File

@ -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();
}
}

View File

@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="minigameClockT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -4,10 +4,10 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D80DBBF2-307F-40A0-86F1-871C8DAA394B}</ProjectGuid>
<ProjectGuid>{DFD89655-00A7-4DF8-8B2E-17F5BEFE5090}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>SIT</RootNamespace>
<AssemblyName>SIT</AssemblyName>
<RootNamespace>LevelTest</RootNamespace>
<AssemblyName>LevelTest</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@ -46,6 +46,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ArrayDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ArrayDialog.Designer.cs">
<DependentUpon>ArrayDialog.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
@ -54,6 +60,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="ArrayDialog.resx">
<DependentUpon>ArrayDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
@ -86,8 +95,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>

View File

@ -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;
}
}

49
LevelTest/MainForm.cs Normal file
View File

@ -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;
}
}
}
}
}

65
LevelTest/Program.cs Normal file
View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[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));
}
}
}

View File

@ -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:
//

View File

@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
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;

View File

@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace SIT.Properties
namespace LevelTest.Properties
{

View File

@ -1,94 +0,0 @@
namespace SIT
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing & (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

View File

@ -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<Vector2> enemies;
List<Vector2> bullets;
Vector2 player;
double speedMod;
bool enemiesCanShoot;
private void initGame()
{
enemies = new List<Vector2>();
bullets = new List<Vector2>();
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<Vector2> enemiesToRemove = new List<Vector2>();
List<Vector2> bulletsToRemove = new List<Vector2>();
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
}
}
}
}

View File

@ -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;
/// <summary>
/// The main entry point for the application.
/// </summary>
[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());
}
}
}

View File

@ -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")]

View File

@ -1,68 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SIT.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,93 +0,0 @@
namespace lv2_t
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

View File

@ -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<Vector2> enemies;
Vector2 player;
int lives;
private void initGame()
{
enemies = new List<Vector2>();
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<Vector2> enemiesToRemove = new List<Vector2>();
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
}
}
}
}

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="minigameClockT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -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")]

View File

@ -1,68 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace lv2_t.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{741EE70E-4CED-40EB-89F2-BD77D41FECED}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>lv2_t</RootNamespace>
<AssemblyName>lv2_t</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{9a9561a7-dd5f-43a5-a3f5-a95f35da204d}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,93 +0,0 @@
namespace lv3_t
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

View File

@ -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<Vector2> 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<Vector2>();
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<Vector2> targetsToRemove = new List<Vector2>();
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
}
}
}
}

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="minigameClockT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -1,68 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace lv3_t.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{244E68E6-90D2-447D-B380-13CA8DD3D4EC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>lv3_t</RootNamespace>
<AssemblyName>lv3_t</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{9a9561a7-dd5f-43a5-a3f5-a95f35da204d}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,93 +0,0 @@
namespace lv3g_t
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

View File

@ -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<int[,]> tetrominoes = new List<int[,]>() { I, O, T, S, Z, J, L };
private readonly int[,] shape;
public List<int[]> location = new List<int[]>();
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<int[]> templocation = new List<int[]>();
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<int[]> location)
{
List<int> ycoords = new List<int>();
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<int[]> location)
{
List<int> xcoords = new List<int>();
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<int[]> location)
{
List<int> xcoords = new List<int>();
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;
}
}
}
}
}

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -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")]

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E6BF80E0-8848-4A6F-B114-FEC5055E1D9E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>lv3g_t</RootNamespace>
<AssemblyName>lv3g_t</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -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<Vector2> 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<Vector2>();
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));
}
}

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="minigameClockT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -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")]

View File

@ -1,68 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace lv4_t.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{22D618C0-F0A4-417F-A815-C760BF4376B2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>lv4_t</RootNamespace>
<AssemblyName>lv4_t</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{9a9561a7-dd5f-43a5-a3f5-a95f35da204d}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -1,94 +0,0 @@
namespace lv_tst_base
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing & (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.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;
}
}

View File

@ -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
}
}
}
}

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="minigameClockT.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@ -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")]

View File

@ -1,68 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace lv_tst_base.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,29 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{52CE6BEB-EC81-4A14-85DD-3F8DB8E33202}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>lv_tst_base</RootNamespace>
<AssemblyName>lv_tst_base</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{9a9561a7-dd5f-43a5-a3f5-a95f35da204d}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>