Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 1dd5a28

Browse files
TaiizorTaiizor
Taiizor
authored and
Taiizor
committed
53X Again 20!
1 parent 59caba2 commit 1dd5a28

33 files changed

+200
-99
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Snake
2-
<p>Snake v1.5</p>
2+
<p>Snake v1.6</p>
33
<p>Visual Studio 2019</p>
4-
<p>.NET Framework 4.8 (Minimum 4.0)</p>
4+
<p>.NET Framework 4.8 (Minimum 4.0) & .NET 5 & .NET 6</p>
55
<img src="https://raw.githubusercontent.com/Taiizor/Snake/master/.screenshots/UI_1.png" />
66
<img src="https://raw.githubusercontent.com/Taiizor/Snake/master/.screenshots/UI_2.png" />
77
<img src="https://raw.githubusercontent.com/Taiizor/Snake/master/.screenshots/UI_3.png" />

Snake/Game.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Snake/Game.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public partial class Game : Form
1717
private readonly int Growth = 5;
1818
private bool Apple = false;
1919
private bool Continue = true;
20-
private readonly Random RNDM = new Random();
20+
private readonly Random RNDM = new();
2121

2222
/*
2323
Array.Clear(Locations, 0, Locations.Length);
@@ -52,10 +52,10 @@ private void Game_Start(object GS)
5252

5353
private void Game_Restart()
5454
{
55-
Pen Pencil = new Pen(Color.White, 9999);
55+
Pen Pencil = new(Color.White, 9999);
5656
Graphics Graph = null;
5757
Graph = CreateGraphics();
58-
SolidBrush Colored = new SolidBrush(Color.White);
58+
SolidBrush Colored = new(Color.White);
5959
Graph.DrawRectangle(Pencil, new Rectangle(VWidth / 2, VHeight / 2, 9999, 9999));
6060
Graph.FillRectangle(Colored, VWidth / 2, VHeight / 2, 9999, 9999);
6161
Pencil.Dispose();
@@ -81,9 +81,9 @@ private enum Direction
8181

8282
private void Tail_Draw(int AX, int AY)
8383
{
84-
Pen Pencil = new Pen(Color.Black, 5);
84+
Pen Pencil = new(Color.Black, 5);
8585
Graphics Graph = CreateGraphics();
86-
SolidBrush Colored = new SolidBrush(Color.Black);
86+
SolidBrush Colored = new(Color.Black);
8787
while (Queue2 != Queue)
8888
{
8989
Graph.DrawRectangle(Pencil, new Rectangle(Locations1[Queue2], Locations2[Queue2], 10, 10));
@@ -112,9 +112,9 @@ private void Apple_Eat(int AX, int AY)
112112
{
113113
Apple = false;
114114
Measurement += Growth;
115-
Pen Pencil = new Pen(Color.White, 5);
115+
Pen Pencil = new(Color.White, 5);
116116
Graphics Graph = CreateGraphics();
117-
SolidBrush Colored = new SolidBrush(Color.White);
117+
SolidBrush Colored = new(Color.White);
118118
Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10));
119119
Graph.FillRectangle(Colored, AX, AY, 10, 10);
120120
Pencil.Dispose();
@@ -129,9 +129,9 @@ private void Apple_Control(object AC)
129129
Apple = true;
130130
AX = RNDM.Next(50, VWidth - 50);
131131
AY = RNDM.Next(50, VHeight - 50);
132-
Pen Pencil = new Pen(Color.Red, 5);
132+
Pen Pencil = new(Color.Red, 5);
133133
Graphics Graph = CreateGraphics();
134-
SolidBrush Colored = new SolidBrush(Color.Red);
134+
SolidBrush Colored = new(Color.Red);
135135
Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10));
136136
Graph.FillRectangle(Colored, AX, AY, 10, 10);
137137
Pencil.Dispose();
@@ -140,9 +140,9 @@ private void Apple_Control(object AC)
140140
}
141141
else
142142
{
143-
Pen Pencil = new Pen(Color.Red, 5);
143+
Pen Pencil = new(Color.Red, 5);
144144
Graphics Graph = CreateGraphics();
145-
SolidBrush Colored = new SolidBrush(Color.Red);
145+
SolidBrush Colored = new(Color.Red);
146146
Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10));
147147
Graph.FillRectangle(Colored, AX, AY, 10, 10);
148148
Pencil.Dispose();
@@ -235,9 +235,9 @@ private void Snake_Tail(object ST)
235235
if (Queue >= Measurement)
236236
{
237237
Queue2 = Queue - Measurement;
238-
Pen Pencil = new Pen(Color.White, 5);
238+
Pen Pencil = new(Color.White, 5);
239239
Graphics Graph = CreateGraphics();
240-
SolidBrush Colored = new SolidBrush(Color.White);
240+
SolidBrush Colored = new(Color.White);
241241
Graph.DrawRectangle(Pencil, new Rectangle(Locations1[Queue2], Locations2[Queue2], 10, 10));
242242
Graph.FillRectangle(Colored, Locations1[Queue2], Locations2[Queue2], 10, 10);
243243
Pencil.Dispose();

Snake/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// set of attributes. Change these attribute values to modify the information
66
// associated with an assembly.
77
[assembly: AssemblyTitle("Snake")]
8-
[assembly: AssemblyDescription("Snake v1.5")]
8+
[assembly: AssemblyDescription("Snake v1.6")]
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Taiizor")]
1111
[assembly: AssemblyProduct("Snake")]
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.5.0.0")]
35-
[assembly: AssemblyFileVersion("1.5.0.0")]
34+
[assembly: AssemblyVersion("1.6.0.0")]
35+
[assembly: AssemblyFileVersion("1.6.0.0")]

Snake/Snake.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ internal static class Snake
1212
/// Uygulamanın ana girdi noktası.
1313
/// </summary>
1414

15-
private static readonly Mutex Mutex = new Mutex(true, "{" + ((GuidAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(GuidAttribute), false)).Value + "}");
15+
private static readonly Mutex Mutex = new(true, "{" + ((GuidAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(GuidAttribute), false)).Value + "}");
1616

1717
[STAThread]
1818
private static void Main()
1919
{
2020
if (Mutex.WaitOne(TimeSpan.Zero, true))
2121
{
2222
Application.EnableVisualStyles();
23+
#if NET5_0 || NET6_0
24+
Application.SetHighDpiMode(HighDpiMode.SystemAware);
25+
#endif
2326
Application.SetCompatibleTextRenderingDefault(false);
2427
Control.CheckForIllegalCrossThreadCalls = false;
2528
Application.Run(new Game());

Snake/Snake.csproj

+11-78
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{B8D48746-8591-48A0-AA1F-696F7CB212E2}</ProjectGuid>
3+
<TargetFrameworks>net48;net5.0-windows;net6.0-windows</TargetFrameworks>
84
<OutputType>WinExe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Snake</RootNamespace>
11-
<AssemblyName>Snake</AssemblyName>
12-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
8+
<AnalysisLevel>preview</AnalysisLevel>
9+
<LangVersion>preview</LangVersion>
10+
<NeutralLanguage>en</NeutralLanguage>
3411
</PropertyGroup>
3512
<PropertyGroup>
3613
<StartupObject>Snake.Snake</StartupObject>
@@ -39,49 +16,10 @@
3916
<ApplicationIcon>Resources\Stumbleupon.ico</ApplicationIcon>
4017
</PropertyGroup>
4118
<ItemGroup>
42-
<Reference Include="Microsoft.VisualBasic" />
4319
<Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
4420
<SpecificVersion>False</SpecificVersion>
4521
<HintPath>Library\Microsoft.VisualBasic.PowerPacks.Vs.dll</HintPath>
4622
</Reference>
47-
<Reference Include="System" />
48-
<Reference Include="System.Drawing" />
49-
<Reference Include="System.Windows.Forms" />
50-
</ItemGroup>
51-
<ItemGroup>
52-
<Compile Include="Game.cs">
53-
<SubType>Form</SubType>
54-
</Compile>
55-
<Compile Include="Game.Designer.cs">
56-
<DependentUpon>Game.cs</DependentUpon>
57-
</Compile>
58-
<Compile Include="Snake.cs" />
59-
<Compile Include="Properties\AssemblyInfo.cs" />
60-
<EmbeddedResource Include="Game.resx">
61-
<DependentUpon>Game.cs</DependentUpon>
62-
</EmbeddedResource>
63-
<EmbeddedResource Include="Properties\Resources.resx">
64-
<Generator>ResXFileCodeGenerator</Generator>
65-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
66-
<SubType>Designer</SubType>
67-
</EmbeddedResource>
68-
<Compile Include="Properties\Resources.Designer.cs">
69-
<AutoGen>True</AutoGen>
70-
<DependentUpon>Resources.resx</DependentUpon>
71-
<DesignTime>True</DesignTime>
72-
</Compile>
73-
<None Include="Properties\Settings.settings">
74-
<Generator>SettingsSingleFileGenerator</Generator>
75-
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
76-
</None>
77-
<Compile Include="Properties\Settings.Designer.cs">
78-
<AutoGen>True</AutoGen>
79-
<DependentUpon>Settings.settings</DependentUpon>
80-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
81-
</Compile>
82-
</ItemGroup>
83-
<ItemGroup>
84-
<None Include="App.config" />
8523
</ItemGroup>
8624
<ItemGroup>
8725
<Resource Include="Resources\Stumbleupon.png" />
@@ -107,12 +45,7 @@
10745
<ItemGroup>
10846
<Resource Include="Resources\Stumbleupon.ico" />
10947
</ItemGroup>
110-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
111-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
112-
Other similar extension points exist, see Microsoft.Common.targets.
113-
<Target Name="BeforeBuild">
114-
</Target>
115-
<Target Name="AfterBuild">
116-
</Target>
117-
-->
48+
<ItemGroup>
49+
<PackageReference Include="Microsoft.VisualBasic" Version="10.4.0-preview.18571.3" />
50+
</ItemGroup>
11851
</Project>

Snake/Snake.csproj.user

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
<ItemGroup>
5+
<Compile Update="Game.cs">
6+
<SubType>Form</SubType>
7+
</Compile>
8+
</ItemGroup>
9+
</Project>

Snake/bin/Release/Snake.pdb

-31.5 KB
Binary file not shown.
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>

Snake/bin/Release/net48/Snake.pdb

4.71 KB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v5.0",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v5.0": {
9+
"Snake/1.0.0": {
10+
"dependencies": {
11+
"Microsoft.VisualBasic": "10.4.0-preview.18571.3",
12+
"Microsoft.VisualBasic.PowerPacks.Vs": "10.0.0.0"
13+
},
14+
"runtime": {
15+
"Snake.dll": {}
16+
}
17+
},
18+
"Microsoft.VisualBasic/10.4.0-preview.18571.3": {},
19+
"Microsoft.VisualBasic.PowerPacks.Vs/10.0.0.0": {
20+
"runtime": {
21+
"Microsoft.VisualBasic.PowerPacks.Vs.dll": {
22+
"assemblyVersion": "10.0.0.0",
23+
"fileVersion": "11.0.50727.1"
24+
}
25+
},
26+
"resources": {
27+
"tr/Microsoft.VisualBasic.PowerPacks.Vs.resources.dll": {
28+
"locale": "tr"
29+
}
30+
}
31+
}
32+
}
33+
},
34+
"libraries": {
35+
"Snake/1.0.0": {
36+
"type": "project",
37+
"serviceable": false,
38+
"sha512": ""
39+
},
40+
"Microsoft.VisualBasic/10.4.0-preview.18571.3": {
41+
"type": "package",
42+
"serviceable": true,
43+
"sha512": "sha512-9o+ngDFh/65nEtLaMJ4I7nsMFqTYStbMzdp0gX0ytOFs77WrCNMoEEt72fRHvDbcPXmFD/+UF6LOPqEdcU//0Q==",
44+
"path": "microsoft.visualbasic/10.4.0-preview.18571.3",
45+
"hashPath": "microsoft.visualbasic.10.4.0-preview.18571.3.nupkg.sha512"
46+
},
47+
"Microsoft.VisualBasic.PowerPacks.Vs/10.0.0.0": {
48+
"type": "reference",
49+
"serviceable": false,
50+
"sha512": ""
51+
}
52+
}
53+
}
217 KB
Binary file not shown.
157 KB
Binary file not shown.
14 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"runtimeOptions": {
3+
"additionalProbingPaths": [
4+
"C:\\Users\\Taiizor\\.dotnet\\store\\|arch|\\|tfm|",
5+
"C:\\Users\\Taiizor\\.nuget\\packages",
6+
"D:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
7+
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet"
8+
]
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "net5.0",
4+
"framework": {
5+
"name": "Microsoft.WindowsDesktop.App",
6+
"version": "5.0.0"
7+
}
8+
}
9+
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)