Added new Level and Vector class

This commit is contained in:
CreepyCrafter24 2019-07-27 20:57:23 +02:00
parent 3309c40d44
commit cf4d9d6e85
45 changed files with 1966 additions and 259 deletions

118
1/1.cs
View File

@ -59,123 +59,87 @@ namespace LaptopSimulator2015.Levels
public Panel desktopIcon { get; set; }
public int installerProgressSteps => 200;
public int installerProgressSteps => 500;
List<Point> invadersAliens = new List<Point>();
List<Point> invadersBullets = new List<Point>();
Point invadersPlayer;
uint invadersPrevTime = 0;
List<Vector2> invadersAliens = new List<Vector2>();
List<Vector2> invadersBullets = new List<Vector2>();
Vector2 invadersPlayer;
uint minigamePrevTime = 0;
bool invadersCanShoot = true;
public void gameTick(Graphics g, Panel invadersPanel, Timer invadersTimer, uint invadersTime)
public void gameTick(Graphics g, Panel minigamePanel, Timer minigameTimer, uint minigameTime)
{
try
{
g.Clear(Color.Black);
for (int i = 0; i < invadersAliens.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(invadersAliens[i], new Size(10, 10)));
g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(invadersAliens[i].toPoint(), new Size(10, 10)));
}
for (int i = 0; i < invadersBullets.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(invadersBullets[i], new Size(5, 5)));
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(invadersBullets[i].toPoint(), new Size(5, 5)));
}
g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(invadersPlayer, new Size(10, 10)));
g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(invadersPlayer.toPoint(), new Size(10, 10)));
Random random = new Random();
if (invadersTime != invadersPrevTime)
if (minigameTime != minigamePrevTime)
{
if (random.Next(0, 100000) < invadersTime + 1300)
invadersAliens.Add(new Point(invadersPanel.Width, random.Next(invadersPanel.Height - 10)));
invadersPrevTime = invadersTime;
minigamePrevTime = minigameTime;
if (random.Next(0, 100000) < minigameTime + 1300)
invadersAliens.Add(new Vector2(minigamePanel.Width, random.Next(minigamePanel.Height - 10)));
for (int i = 0; i < invadersAliens.Count; i++)
{
invadersAliens[i] = new Point(invadersAliens[i].X - 1, invadersAliens[i].Y);
if (Math.Pow(invadersPlayer.X - invadersAliens[i].X, 2) + Math.Pow(invadersPlayer.Y - invadersAliens[i].Y, 2) < 100 | invadersAliens[i].X < 0)
invadersAliens[i].X -= 1;
if (invadersPlayer.distanceFromSquared(invadersAliens[i]) < 100 | invadersAliens[i].X < 0)
{
invadersTimer.Enabled = false;
g.Clear(Color.Red);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
RectangleF rectf = new RectangleF(invadersPanel.Width / 2, invadersPanel.Height / 2, 90, 50);
g.DrawString("Lost.", new Font("Tahoma", 20), Brushes.Black, rectf);
throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe"));
}
}
invadersCanShoot = invadersCanShoot | !IsKeyDown(Keys.Space);
List<int> aliensToRemove = new List<int>();
List<int> bulletsToRemove = new List<int>();
invadersCanShoot = invadersCanShoot | !Input.IsKeyDown(Keys.Space);
List<Vector2> aliensToRemove = new List<Vector2>();
List<Vector2> bulletsToRemove = new List<Vector2>();
for (int i = 0; i < invadersBullets.Count; i++)
{
invadersBullets[i] = new Point(invadersBullets[i].X + 4, invadersBullets[i].Y);
invadersBullets[i].X += 4;
for (int j = 0; j < invadersAliens.Count; j++)
{
if (Math.Pow(invadersBullets[i].X - invadersAliens[j].X - 2.5f, 2) + Math.Pow(invadersBullets[i].Y - invadersAliens[j].Y - 2.5f, 2) < 56.25f)
if (invadersBullets[i].distanceFromSquared(invadersAliens[j] + new Vector2(2.5f, 2.5f)) < 56.25f)
{
if (!aliensToRemove.Contains(j))
aliensToRemove.Add(j);
if (!bulletsToRemove.Contains(i))
bulletsToRemove.Add(i);
aliensToRemove.Add(invadersAliens[j]);
bulletsToRemove.Add(invadersBullets[i]);
}
}
if (invadersBullets[i].X > invadersPanel.Width)
bulletsToRemove.Add(i);
if (invadersBullets[i].X > minigamePanel.Width)
bulletsToRemove.Add(invadersBullets[i]);
}
aliensToRemove = aliensToRemove.Distinct().ToList();
aliensToRemove.Sort();
aliensToRemove.Reverse();
bulletsToRemove = bulletsToRemove.Distinct().ToList();
bulletsToRemove.Sort();
bulletsToRemove.Reverse();
for (int i = 0; i < aliensToRemove.Count; i++)
{
try
{
invadersAliens.RemoveAt(aliensToRemove[i]);
}
catch { }
}
for (int i = 0; i < bulletsToRemove.Count; i++)
{
try
{
invadersBullets.RemoveAt(bulletsToRemove[i]);
}
catch { }
}
if (IsKeyDown(Keys.W))
invadersAliens = invadersAliens.Except(aliensToRemove.Distinct()).Distinct().ToList();
invadersBullets = invadersBullets.Except(bulletsToRemove.Distinct()).Distinct().ToList();
if (Input.IsKeyDown(Keys.W))
invadersPlayer.Y -= 2;
if (IsKeyDown(Keys.A))
if (Input.IsKeyDown(Keys.A))
invadersPlayer.X -= 2;
if (IsKeyDown(Keys.S))
if (Input.IsKeyDown(Keys.S))
invadersPlayer.Y += 2;
if (IsKeyDown(Keys.D))
if (Input.IsKeyDown(Keys.D))
invadersPlayer.X += 2;
if (IsKeyDown(Keys.Space) & invadersCanShoot)
if (Input.IsKeyDown(Keys.Space) & invadersCanShoot)
{
invadersBullets.Add(invadersPlayer);
invadersBullets.Add(new Vector2(invadersPlayer));
invadersCanShoot = false;
}
if (invadersPlayer.X < 0)
invadersPlayer.X = invadersPanel.Width;
if (invadersPlayer.X > invadersPanel.Width)
invadersPlayer.X = 0;
if (invadersPlayer.Y < 0)
invadersPlayer.Y = invadersPanel.Height;
if (invadersPlayer.Y > invadersPanel.Height)
invadersPlayer.Y = 0;
}
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
catch (Exception ex) { if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe") throw new Exception(ex.Message); else Console.WriteLine(ex.ToString()); }
}
bool IsKeyDown(Keys key) => Input.IsKeyDown(key);
public void initGame(Graphics g, Panel invadersPanel, Timer invadersTimer)
public void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer)
{
invadersPlayer = new Point(invadersPanel.Width / 4, invadersPanel.Height / 2);
invadersAliens = new List<Point>();
invadersBullets = new List<Point>();
invadersPrevTime = 0;
invadersPlayer = new Vector2(minigamePanel.Width / 4, minigamePanel.Height / 2);
invadersPlayer.bounds_wrap = true;
invadersPlayer.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10);
invadersAliens = new List<Vector2>();
invadersBullets = new List<Vector2>();
minigamePrevTime = 0;
invadersCanShoot = true;
}
}

133
2/2.cs Normal file

File diff suppressed because one or more lines are too long

60
2/2.csproj Normal file
View File

@ -0,0 +1,60 @@
<?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>{0965C803-49B2-4311-B62F-1E60DBD9185F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>_2</RootNamespace>
<AssemblyName>2</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<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.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="2.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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" />
<PropertyGroup>
<PostBuildEvent>if not exist "$(SolutionDir)tmp" mkdir "$(SolutionDir)tmp"
copy "$(TargetPath)" "$(SolutionDir)tmp"</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,36 @@
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("2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("2")]
[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("0965c803-49b2-4311-b62f-1e60dbd9185f")]
// 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

@ -45,7 +45,9 @@
<ItemGroup>
<Compile Include="Input.cs" />
<Compile Include="Level.cs" />
<Compile Include="Misc.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Vector2.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View File

@ -17,7 +17,7 @@ namespace LaptopSimulator2015
int gameClock { get; }
Panel desktopIcon { get; set; }
int installerProgressSteps { get; }
void initGame(Graphics g, Panel invadersPanel, Timer invadersTimer);
void gameTick(Graphics g, Panel invadersPanel, Timer invadersTimer, uint invadersTime);
void initGame(Graphics g, Panel minigamePanel, Timer minigameTimer);
void gameTick(Graphics g, Panel minigamePanel, Timer minigameTimer, uint minigameTime);
}
}

27
Base/Misc.cs Normal file
View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Base
{
public static class Misc
{
public static float d2f(double input)
{
float result = Convert.ToSingle(input);
if (float.IsPositiveInfinity(result))
result = float.MaxValue;
else if (float.IsNegativeInfinity(result))
result = float.MinValue;
return result;
}
public static int f2i(float input) => (int)Math.Round(input);
public static int d2i(double input) => f2i(d2f(input));
public static float i2f(int input) => input;
public static double i2d(int input) => input;
public static double f2d(float input) => input;
}
}

126
Base/Vector2.cs Normal file
View File

@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Base
{
public class Vector2
{
public static readonly Vector2 Zero = new Vector2(Point.Empty);
double x_unchecked = 0;
double y_unchecked = 0;
void check()
{
if (!bounds.IsEmpty)
{
if (bounds_wrap)
{
if (bounds.Width < 0)
throw new ArgumentException("bounds.Width must be greater than or equal to 0");
while (bounds.X != 0 & x_unchecked > bounds.X + bounds.Width)
x_unchecked -= bounds.Width;
while (x_unchecked < bounds.X)
x_unchecked += bounds.Width;
if (bounds.Height < 0)
throw new ArgumentException("bounds.Height must be greater than or equal to 0");
while (bounds.Y != 0 & y_unchecked > bounds.Y + bounds.Height)
y_unchecked -= bounds.Height;
while (y_unchecked < bounds.Y)
y_unchecked += bounds.Height;
}
else
{
x_unchecked = Math.Min(Math.Max(x_unchecked, bounds.X), bounds.X + bounds.Width);
y_unchecked = Math.Min(Math.Max(y_unchecked, bounds.Y), bounds.Y + bounds.Height);
}
}
}
public double X
{
get {
check();
return x_unchecked;
}
set {
x_unchecked = value;
check();
}
}
public double Y
{
get {
check();
return y_unchecked;
}
set {
y_unchecked = value;
check();
}
}
public Rectangle bounds;
public bool bounds_wrap = false;
public Vector2(double x = 0, double y = 0)
{
X = x;
Y = y;
}
public Vector2(Point from)
{
X = from.X;
Y = from.Y;
}
public Vector2(PointF from)
{
X = from.X;
Y = from.Y;
}
public Vector2(Vector2 from)
{
X = from.X;
Y = from.Y;
}
public Point toPoint() => new Point((int)Math.Round(X), (int)Math.Round(Y));
public PointF toPointF() => new PointF(Misc.d2f(X), Misc.d2f(Y));
public double distanceFromSquared(Vector2 other) => Math.Pow(X - other.X, 2) + Math.Pow(Y - other.Y, 2);
public double distanceFrom(Vector2 other) => Math.Sqrt(distanceFromSquared(other));
public void moveInDirection(double angle = 0, double distance = 1)
{
X += Math.Cos(angle) * distance;
Y += Math.Sin(angle) * distance;
}
public double getDirection(Vector2 other) => Math.Atan((other.X - X) / (other.Y - Y));
public void moveTowards(Vector2 other, double distance = 1, bool stopAtTarget = true)
{
double dist = distanceFrom(other);
if (stopAtTarget & distance >= dist)
{
X = other.X;
Y = other.Y;
}
else
{
double k = distance / dist;
double localX = other.X - X;
double localY = other.Y - Y;
X = localX * k + X;
Y = localY * k + Y;
}
}
public override string ToString() => "{X=" + X.ToString() + ", Y=" + Y.ToString() + "}";
public static Vector2 operator +(Vector2 left, Vector2 right) => new Vector2(left.X + right.X, left.Y + right.Y);
public static Vector2 operator -(Vector2 left, Vector2 right) => new Vector2(left.X - right.X, left.Y - right.Y);
public static Vector2 operator *(Vector2 left, Vector2 right) => new Vector2(left.X * right.X, left.Y * right.Y);
public static Vector2 operator /(Vector2 left, Vector2 right) => new Vector2(left.X / right.X, left.Y / right.Y);
}
}

View File

@ -5,11 +5,10 @@ VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaptopSimulator2015", "LaptopSimulator2015\LaptopSimulator2015.csproj", "{ADBFC08F-A516-4790-9F9E-FB3000619E2A}"
ProjectSection(ProjectDependencies) = postProject
{0965C803-49B2-4311-B62F-1E60DBD9185F} = {0965C803-49B2-4311-B62F-1E60DBD9185F}
{DFA2FB97-D676-4B0D-B281-2685F85781EE} = {DFA2FB97-D676-4B0D-B281-2685F85781EE}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SIT", "SIT\SIT.csproj", "{D80DBBF2-307F-40A0-86F1-871C8DAA394B}"
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}"
@ -18,6 +17,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Base", "Base\Base.csproj",
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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -28,10 +35,6 @@ Global
{ADBFC08F-A516-4790-9F9E-FB3000619E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADBFC08F-A516-4790-9F9E-FB3000619E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADBFC08F-A516-4790-9F9E-FB3000619E2A}.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
{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -40,14 +43,33 @@ 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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D80DBBF2-307F-40A0-86F1-871C8DAA394B} = {69DC5824-3F89-4B47-BF1A-F25942094195}
{9A9561A7-DD5F-43A5-A3F5-A95F35DA204D} = {83BF22F9-3A2D-42A3-9DB0-C1E2AA1DD218}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9631F8FF-AFC1-4583-9D27-6C2D97D3A2E9}

View File

@ -625,7 +625,7 @@ namespace LaptopSimulator2015
private System.Windows.Forms.Label levelWindowTitle;
private System.Windows.Forms.Panel levelWindowIcon;
private System.Windows.Forms.Label levelWindowText1;
private TabControlH levelWindowContents;
private LaptopSimulator2015.FakeDesktop.TabControlH levelWindowContents;
private System.Windows.Forms.TabPage levelWindow1;
private System.Windows.Forms.TabPage levelWindow2;
private System.Windows.Forms.Button levelWindowC1;

View File

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@ -18,7 +19,7 @@ namespace LaptopSimulator2015
Console.Title = "LaptopSimulator2015";
#if DEBUG
FileStream filestream = new FileStream(".log", FileMode.Create);
var streamwriter = new StreamWriter(filestream);
StreamWriter streamwriter = new StreamWriter(filestream);
streamwriter.AutoFlush = true;
Console.SetOut(streamwriter);
Console.SetError(streamwriter);

View File

@ -1,150 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace SIT
{
public partial class MainForm : Form
{
List<Point> invadersAliens = new List<Point>();
List<Point> invadersBullets = new List<Point>();
Point invadersPlayer;
uint invadersTime = 0;
uint invadersPrevTime = 0;
bool invadersCanShoot = true;
public MainForm()
{
InitializeComponent();
invadersPlayer = new Point(invadersPanel.Width / 4, invadersPanel.Height / 2);
}
private void Panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
try
{
g.Clear(Color.Black);
for (int i = 0; i < invadersAliens.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(invadersAliens[i], new Size(10, 10)));
}
for (int i = 0; i < invadersBullets.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(invadersBullets[i], new Size(5, 5)));
}
g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(invadersPlayer, new Size(10, 10)));
Random random = new Random();
if (invadersTime != invadersPrevTime)
{
if (random.Next(0, 100000) < invadersTime + 1300)
invadersAliens.Add(new Point(invadersPanel.Width, random.Next(invadersPanel.Height - 10)));
invadersPrevTime = invadersTime;
for (int i = 0; i < invadersAliens.Count; i++)
{
invadersAliens[i] = new Point(invadersAliens[i].X - 1, invadersAliens[i].Y);
if (Math.Pow(invadersPlayer.X - invadersAliens[i].X, 2) + Math.Pow(invadersPlayer.Y - invadersAliens[i].Y, 2) < 100 | invadersAliens[i].X < 0)
{
invadersTimer.Enabled = false;
g.Clear(Color.Red);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
RectangleF rectf = new RectangleF(invadersPanel.Width / 2, invadersPanel.Height / 2, 90, 50);
g.DrawString("Lost.", new Font("Tahoma", 20), Brushes.Black, rectf);
}
}
invadersCanShoot = invadersCanShoot | !IsKeyDown(Keys.Space);
List<int> aliensToRemove = new List<int>();
List<int> bulletsToRemove = new List<int>();
for (int i = 0; i < invadersBullets.Count; i++)
{
invadersBullets[i] = new Point(invadersBullets[i].X + 4, invadersBullets[i].Y);
for (int j = 0; j < invadersAliens.Count; j++)
{
if (Math.Pow(invadersBullets[i].X - invadersAliens[j].X - 2.5f, 2) + Math.Pow(invadersBullets[i].Y - invadersAliens[j].Y - 2.5f, 2) < 56.25f)
{
if (!aliensToRemove.Contains(j))
aliensToRemove.Add(j);
if (!bulletsToRemove.Contains(i))
bulletsToRemove.Add(i);
}
}
if (invadersBullets[i].X > invadersPanel.Width)
bulletsToRemove.Add(i);
}
aliensToRemove = aliensToRemove.Distinct().ToList();
aliensToRemove.Sort();
aliensToRemove.Reverse();
bulletsToRemove = bulletsToRemove.Distinct().ToList();
bulletsToRemove.Sort();
bulletsToRemove.Reverse();
for (int i = 0; i < aliensToRemove.Count; i++)
{
try
{
invadersAliens.RemoveAt(aliensToRemove[i]);
}
catch { }
}
for (int i = 0; i < bulletsToRemove.Count; i++)
{
try
{
invadersBullets.RemoveAt(bulletsToRemove[i]);
}
catch { }
}
if (IsKeyDown(Keys.W))
invadersPlayer.Y -= 2;
if (IsKeyDown(Keys.A))
invadersPlayer.X -= 2;
if (IsKeyDown(Keys.S))
invadersPlayer.Y += 2;
if (IsKeyDown(Keys.D))
invadersPlayer.X += 2;
if (IsKeyDown(Keys.Space) & invadersCanShoot)
{
invadersBullets.Add(invadersPlayer);
invadersCanShoot = false;
}
if (invadersPlayer.X < 0)
invadersPlayer.X = invadersPanel.Width;
if (invadersPlayer.X > invadersPanel.Width)
invadersPlayer.X = 0;
if (invadersPlayer.Y < 0)
invadersPlayer.Y = invadersPanel.Height;
if (invadersPlayer.Y > invadersPanel.Height)
invadersPlayer.Y = 0;
}
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
}
private void Timer1_Tick(object sender, EventArgs e)
{
invadersTime++;
invadersPanel.Invalidate();
}
private void Button1_Click(object sender, EventArgs e) => Application.Exit();
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
private static extern short GetKeyState(int keyCode);
public static bool IsKeyDown(Keys key)
{
int state = 0;
short retVal = GetKeyState((int)key);
if ((retVal & 0x8000) == 0x8000)
state |= 1;
if ((retVal & 1) == 1)
state |= 2;
return 1 == (state & 1);
}
}
}

View File

@ -29,22 +29,22 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.invadersPanel = new System.Windows.Forms.Panel();
this.minigamePanel = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.invadersTimer = new System.Windows.Forms.Timer(this.components);
this.invadersPanel.SuspendLayout();
this.minigameClockT = new System.Windows.Forms.Timer(this.components);
this.minigamePanel.SuspendLayout();
this.SuspendLayout();
//
// invadersPanel
// minigamePanel
//
this.invadersPanel.BackColor = System.Drawing.Color.Black;
this.invadersPanel.Controls.Add(this.button1);
this.invadersPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.invadersPanel.Location = new System.Drawing.Point(0, 0);
this.invadersPanel.Name = "invadersPanel";
this.invadersPanel.Size = new System.Drawing.Size(800, 450);
this.invadersPanel.TabIndex = 0;
this.invadersPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.Panel1_Paint);
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
//
@ -57,11 +57,11 @@
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.Button1_Click);
//
// invadersTimer
// minigameClockT
//
this.invadersTimer.Enabled = true;
this.invadersTimer.Interval = 17;
this.invadersTimer.Tick += new System.EventHandler(this.Timer1_Tick);
this.minigameClockT.Enabled = true;
this.minigameClockT.Interval = 17;
this.minigameClockT.Tick += new System.EventHandler(this.Timer1_Tick);
//
// MainForm
//
@ -70,7 +70,7 @@
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ControlBox = false;
this.Controls.Add(this.invadersPanel);
this.Controls.Add(this.minigamePanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
@ -79,15 +79,15 @@
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.invadersPanel.ResumeLayout(false);
this.minigamePanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel invadersPanel;
private System.Windows.Forms.Timer invadersTimer;
private System.Windows.Forms.Panel minigamePanel;
private System.Windows.Forms.Timer minigameClockT;
private System.Windows.Forms.Button button1;
}
}

121
lv1_t/MainForm.cs Normal file
View File

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Base;
namespace SIT
{
public partial class MainForm : Form
{
List<Vector2> invadersAliens = new List<Vector2>();
List<Vector2> invadersBullets = new List<Vector2>();
Vector2 invadersPlayer;
uint minigameTime = 0;
uint minigamePrevTime = 0;
bool invadersCanShoot = true;
public MainForm()
{
InitializeComponent();
invadersPlayer = new Vector2(minigamePanel.Width / 4, minigamePanel.Height / 2);
invadersPlayer.bounds_wrap = true;
invadersPlayer.bounds = new Rectangle(-10, -10, minigamePanel.Width + 10, minigamePanel.Height + 10);
}
private void Panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
try
{
g.Clear(Color.Black);
for (int i = 0; i < invadersAliens.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.Red), new Rectangle(invadersAliens[i].toPoint(), new Size(10, 10)));
}
for (int i = 0; i < invadersBullets.Count; i++)
{
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(invadersBullets[i].toPoint(), new Size(5, 5)));
}
g.FillRectangle(new SolidBrush(Color.Green), new Rectangle(invadersPlayer.toPoint(), new Size(10, 10)));
Random random = new Random();
if (minigameTime != minigamePrevTime)
{
minigamePrevTime = minigameTime;
if (random.Next(0, 100000) < minigameTime + 1300)
invadersAliens.Add(new Vector2(minigamePanel.Width, random.Next(minigamePanel.Height - 10)));
for (int i = 0; i < invadersAliens.Count; i++)
{
invadersAliens[i].X -= 1;
if (invadersPlayer.distanceFromSquared(invadersAliens[i]) < 100 | invadersAliens[i].X < 0)
{
throw new Exception("The VM was shut down to prevent damage to your Machine.", new Exception("0717750f-3508-4bc2-841e-f3b077c676fe"));
}
}
invadersCanShoot = invadersCanShoot | !Input.IsKeyDown(Keys.Space);
List<Vector2> aliensToRemove = new List<Vector2>();
List<Vector2> bulletsToRemove = new List<Vector2>();
for (int i = 0; i < invadersBullets.Count; i++)
{
invadersBullets[i].X += 4;
for (int j = 0; j < invadersAliens.Count; j++)
{
if (invadersBullets[i].distanceFromSquared(invadersAliens[j] + new Vector2(2.5f, 2.5f)) < 56.25f)
{
aliensToRemove.Add(invadersAliens[j]);
bulletsToRemove.Add(invadersBullets[i]);
}
}
if (invadersBullets[i].X > minigamePanel.Width)
bulletsToRemove.Add(invadersBullets[i]);
}
invadersAliens = invadersAliens.Except(aliensToRemove.Distinct()).Distinct().ToList();
invadersBullets = invadersBullets.Except(bulletsToRemove.Distinct()).Distinct().ToList();
if (Input.IsKeyDown(Keys.W))
invadersPlayer.Y -= 2;
if (Input.IsKeyDown(Keys.A))
invadersPlayer.X -= 2;
if (Input.IsKeyDown(Keys.S))
invadersPlayer.Y += 2;
if (Input.IsKeyDown(Keys.D))
invadersPlayer.X += 2;
if (Input.IsKeyDown(Keys.Space) & invadersCanShoot)
{
invadersBullets.Add(new Vector2(invadersPlayer));
invadersCanShoot = false;
}
}
}
catch (Exception ex) {
if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe")
{
minigameClockT.Enabled = false;
g.Clear(Color.Red);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
SizeF sLen = g.MeasureString("Lost.", new Font("Tahoma", 20));
RectangleF rectf = new RectangleF(minigamePanel.Width / 2 - sLen.Width / 2, minigamePanel.Height / 2 - sLen.Height / 2, 90, 50);
g.DrawString("Lost.", new Font("Tahoma", 20), Brushes.Black, rectf);
}
else
#if DEBUG
throw;
#else
Console.WriteLine(ex.ToString());
#endif
}
}
private void Timer1_Tick(object sender, EventArgs e)
{
minigameTime++;
minigamePanel.Invalidate();
}
private void Button1_Click(object sender, EventArgs e) => Application.Exit();
}
}

View File

@ -117,7 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="invadersTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<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

@ -80,6 +80,12 @@
<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" />
<PropertyGroup>
<PreBuildEvent>

6
lv2_t/App.config Normal file
View File

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

93
lv2_t/MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,93 @@
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;
}
}

113
lv2_t/MainForm.cs Normal file
View File

@ -0,0 +1,113 @@
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.Tasks;
using System.Windows.Forms;
using Base;
namespace lv2_t
{
public partial class MainForm : Form
{
#region FRMBD
uint minigameTime = 0;
uint minigamePrevTime = 0;
public MainForm()
{
InitializeComponent();
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);
}
private void Button1_Click(object sender, EventArgs e) => Application.Exit();
private void MinigameClockT_Tick(object sender, EventArgs e)
{
minigameTime++;
minigamePanel.Invalidate();
}
#endregion
List<Vector2> enemies = new List<Vector2>();
Vector2 player;
int lives = 3;
private void MinigamePanel_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
try
{
Random random = new Random();
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)));
g.DrawString(lives.ToString(), new Font("Tahoma", 7), Brushes.White, new Rectangle(player.toPoint(), new Size(10, 10)));
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.IsKeyDown(Keys.W))
player.Y -= 5;
if (Input.IsKeyDown(Keys.A))
player.X -= 5;
if (Input.IsKeyDown(Keys.S))
player.Y += 5;
if (Input.IsKeyDown(Keys.D))
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)));
if (player.distanceFromSquared(enemies[i]) < 100)
{
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"));
}
for (int j = 0; j < enemies.Count; j++)
{
if (i != j & enemies[i].distanceFromSquared(enemies[j]) < 25)
enemiesToRemove.Add(enemies[i]);
}
}
enemies = enemies.Except(enemiesToRemove.Distinct()).Distinct().ToList();
}
}
catch (Exception ex)
{
if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe")
{
minigameClockT.Enabled = false;
g.Clear(Color.Red);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
SizeF sLen = g.MeasureString("Lost.", new Font("Tahoma", 20));
RectangleF rectf = new RectangleF(minigamePanel.Width / 2 - sLen.Width / 2, minigamePanel.Height / 2 - sLen.Height / 2, 90, 50);
g.DrawString("Lost.", new Font("Tahoma", 20), Brushes.Black, rectf);
}
else
#if DEBUG
throw;
#else
Console.WriteLine(ex.ToString());
#endif
}
}
}
}

123
lv2_t/MainForm.resx Normal file
View File

@ -0,0 +1,123 @@
<?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>

22
lv2_t/Program.cs Normal file
View File

@ -0,0 +1,22 @@
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

@ -0,0 +1,36 @@
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")]

68
lv2_t/Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <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

@ -0,0 +1,117 @@
<?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>

29
lv2_t/Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <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

@ -0,0 +1,7 @@
<?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>

89
lv2_t/lv2_t.csproj Normal file
View File

@ -0,0 +1,89 @@
<?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>

6
lv_tst_base/App.config Normal file
View File

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

94
lv_tst_base/MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,94 @@
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;
}
}

65
lv_tst_base/MainForm.cs Normal file
View File

@ -0,0 +1,65 @@
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.Tasks;
using System.Windows.Forms;
using Base;
namespace lv_tst_base
{
public partial class MainForm : Form
{
#region FRMBD
uint minigameTime = 0;
uint minigamePrevTime = 0;
public MainForm() => InitializeComponent();
private void Button1_Click(object sender, EventArgs e) => Application.Exit();
private void MinigameClockT_Tick(object sender, EventArgs e)
{
minigameTime++;
minigamePanel.Invalidate();
}
#endregion
private void MinigamePanel_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
try
{
g.Clear(Color.Black);
//Draw Sprites
Random random = new Random();
if (minigameTime != minigamePrevTime)
{
minigamePrevTime = minigameTime;
//Game Logic
}
}
catch (Exception ex)
{
if (ex.InnerException?.Message == "0717750f-3508-4bc2-841e-f3b077c676fe")
{
minigameClockT.Enabled = false;
g.Clear(Color.Red);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
SizeF sLen = g.MeasureString("Lost.", new Font("Tahoma", 20));
RectangleF rectf = new RectangleF(minigamePanel.Width / 2 - sLen.Width / 2, minigamePanel.Height / 2 - sLen.Height / 2, 90, 50);
g.DrawString("Lost.", new Font("Tahoma", 20), Brushes.Black, rectf);
}
else
#if DEBUG
throw;
#else
Console.WriteLine(ex.ToString());
#endif
}
}
}
}

123
lv_tst_base/MainForm.resx Normal file
View File

@ -0,0 +1,123 @@
<?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>

22
lv_tst_base/Program.cs Normal file
View File

@ -0,0 +1,22 @@
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

@ -0,0 +1,36 @@
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

@ -0,0 +1,68 @@
//------------------------------------------------------------------------------
// <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

@ -0,0 +1,117 @@
<?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

@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <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

@ -0,0 +1,7 @@
<?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

@ -0,0 +1,89 @@
<?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>