Commit d343e4be authored by pixeldesu's avatar pixeldesu
Browse files

initial commit;

parents
No related merge requests found
Showing with 1307 additions and 0 deletions
+1307 -0
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
.gitignore 0 → 100644
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
</startup>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" 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>{89762869-240B-4A01-99D0-DB968B21C992}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FarmingGame</RootNamespace>
<AssemblyName>FarmingGame</AssemblyName>
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</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="MetroFramework">
<HintPath>E:\Projects\winforms-modernui-master\MetroFramework\bin\Debug\MetroFramework.dll</HintPath>
</Reference>
<Reference Include="MetroFramework.Design">
<HintPath>E:\Projects\winforms-modernui-master\MetroFramework.Design\bin\Debug\MetroFramework.Design.dll</HintPath>
</Reference>
<Reference Include="MetroFramework.Fonts">
<HintPath>E:\Projects\winforms-modernui-master\MetroFramework.Fonts\bin\Debug\MetroFramework.Fonts.dll</HintPath>
</Reference>
<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.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.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>
<DesignTime>True</DesignTime>
</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>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
This diff is collapsed.
Form1.cs 0 → 100644
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Forms;
using MetroFramework.Forms;
using MetroFramework;
namespace FarmingGame
{
public partial class MainForm : MetroForm
{
public int Wheat = 1000;
public int People = 2;
public int Fields = 1;
public int PeopleInWar = 0;
public int Gold = 200;
public int price_buyWheat = 4;
public int price_sellWheat = 2;
public int price_buyFields = 320;
public int price_sellFields = 160;
private Timer timerWar;
private Timer timerWar2;
private Timer timerFields;
private Timer progressWar;
private Timer progressBarTimer;
private Timer timerEvents;
private Timer timerPrices;
private Timer timerNewPrices;
public MainForm()
{
InitializeComponent();
label_Wheat.Text = "Wheat: " + Wheat;
label_People.Text = "People: " + People;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
label_buyWheat.Text = "...for " + price_buyWheat + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat + " gold.";
label_buyFields.Text = "...for " + price_buyWheat + " gold.";
label_sellFields.Text = "...for " + price_sellWheat + " gold.";
timerWheat.Start();
timerFields = new Timer();
timerFields.Tick += timerFields_Tick;
timerFields.Interval = 100;
timerFields.Start();
progressBarTimer = new Timer();
progressBarTimer.Tick += progressBarTimer_Tick;
progressBarTimer.Interval = 1000;
progressBarTimer.Start();
timerEvents = new Timer();
timerEvents.Tick += timerEvents_Tick;
timerEvents.Interval = 30000;
timerEvents.Start();
timerWar = new Timer();
timerWar.Tick += timerWar_Tick;
timerWar.Interval = 60000;
timerWar2 = new Timer();
timerWar2.Tick += timerWar2_Tick;
timerWar2.Interval = 60000;
timerPrices = new Timer();
timerPrices.Tick += timerPrices_Tick;
timerPrices.Interval = 1000;
timerPrices.Start();
timerNewPrices = new Timer();
timerNewPrices.Tick += timerNewPrices_Tick;
timerNewPrices.Interval = 60000;
timerNewPrices.Start();
progressWar = new Timer();
progressWar.Tick += progressWar_Tick;
progressWar.Interval = 1000;
}
void progressWar_Tick(object sender, EventArgs e)
{
timeWar.Value = (timeWar.Value + 1) % 60;
timeWar2.Value = timeWar.Value;
timeWar3.Value = timeWar.Value;
if (timeWar.Value >= 59)
{
progressWar.Stop();
timeWar.Hide();
timeWar2.Hide();
timeWar3.Hide();
}
}
void timerWar2_Tick(object sender, EventArgs e)
{
Random random = new Random();
bool Pool;
Pool = (random.Next() % 2) == 0;
PeopleInWar -= 1;
if (Pool)
{
MessageBox.Show("a someone died\nrt if u cride");
label_PeopleInWar.Text = "In War: " + PeopleInWar;
}
else
{
People += 1;
label_People.Text = "People: " + People;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
int neugold_kriegt = random.Next() % 500 + 1;
Gold += neugold_kriegt;
label_Gold.Text = "Gold: " + Gold;
MessageBox.Show("Der Führer siegte. Heil!\n\nSie haben " + neugold_kriegt + " NG bekommen.");
}
((Timer)sender).Stop();
}
void timerNewPrices_Tick(object sender, EventArgs e)
{
Random random = new Random();
price_buyWheat = random.Next(4, 10);
price_sellWheat = price_buyWheat / 2;
price_buyFields = random.Next(300, 350);
price_sellFields = price_buyFields / 2;
}
void timerPrices_Tick(object sender, EventArgs e)
{
scrollbar_Wheat.Maximum = Wheat;
scrollbar_Fields.Maximum = Fields;
}
void progressBarTimer_Tick(object sender, EventArgs e)
{
timeProgress.Value = (timeProgress.Value + 1) % 30;
timeProgress2.Value = timeProgress.Value;
timeProgress3.Value = timeProgress.Value;
}
void timerEvents_Tick(object sender, EventArgs e)
{
Random random = new Random();
int ev = random.Next() % 6;
Console.WriteLine("Event {0}", ev);
switch (ev)
{
case 0:
People += 1;
label_People.Text = "People: " + People;
MessageBox.Show("A new child was born." /* + " Will it blend?" */);
break;
case 1:
if (People == 1)
{
MessageBox.Show("Nothing happened!");
break;
}
People -= 1;
label_People.Text = "People: " + People;
MessageBox.Show("Someone in your family died." /* + " Yes, it blends!" */);
break;
case 2:
if (People == 1)
{
int war_wheat = random.Next() % 200 + 1;
Wheat -= war_wheat;
MessageBox.Show("Since you're alone at home, you can't send anyone out to \ntake place in the war!\n\nThe army takes " + war_wheat + " wheat with them!");
break;
}
People -= 1;
PeopleInWar += 1;
label_People.Text = "People: " + People;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
timeWar.Show();
timeWar2.Show();
timeWar3.Show();
progressWar.Start();
if (timerWar.Enabled == true)
{
timerWar2.Start();
MessageBox.Show("Civil war! \nOne of your family needs to support the army!");
break;
}
timerWar.Start();
MessageBox.Show("Civil war! \nOne of your family needs to support the army!");
break;
case 3:
int wheat_decrease = random.Next() % (Wheat - (Wheat / 2))+1;
Wheat -= wheat_decrease;
label_Wheat.Text = "Wheat: " + Wheat;
MessageBox.Show("Bad weather destroyed a part of your crops!\n\nYou lost " + wheat_decrease + " wheat.");
break;
case 4:
Fields -= 1;
label_Fields.Text = "Fields: " + Wheat;
MessageBox.Show("One of your fields is now uncultivated, it's \nnot usable anymore.");
break;
case 5:
int gold_decrease = random.Next() % (Gold - (Gold / 2)) + 1;
Gold -= gold_decrease;
label_Gold.Text = "Gold: " + Gold;
MessageBox.Show("A debt-collector visited you.\n\nHe took " + gold_decrease + " gold with him");
break;
}
}
void timerWar_Tick(object sender, EventArgs e)
{
Random random = new Random();
bool Pool;
Pool = (random.Next() % 2) == 0;
PeopleInWar -= 1;
if (Pool)
{
MessageBox.Show("a someone died\nrt if u cride");
label_PeopleInWar.Text = "In War: " + PeopleInWar;
}
else
{
People += 1;
label_People.Text = "People: " + People;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
int gold_acquired = random.Next() % 500+1;
Gold += gold_acquired;
label_Gold.Text = "Gold: " + Gold;
MessageBox.Show("Your army won the civil war!\n\nYou got " + gold_acquired + " gold as reward.");
}
((Timer)sender).Stop();
}
void timerFields_Tick(object sender, EventArgs e)
{
Wheat += 1 * Fields;
label_Fields.Text = "Fields: " + Fields;
label_Wheat.Text = (Wheat == 420 ? "Weed: " : (Wheat == 1337 ? "Leet: " : "Wheat: ")) + Wheat;
}
private void timerWheat_Tick(object sender, EventArgs e)
{
Wheat -= People;
label_Wheat.Text = (Wheat == 420 ? "Weed: " : (Wheat == 1337 ? "Leet: " : "Wheat: ")) + Wheat;
if (Wheat <= 0)
{
timerWheat.Stop();
timerFields.Stop();
progressWar.Stop();
timerPrices.Stop();
timerNewPrices.Stop();
timerEvents.Stop();
progressBarTimer.Stop();
timeProgress.Value = 0;
timeProgress2.Value = 0;
timeWar.Value = 0;
MessageBox.Show("You lost the game!\n\nIf you want to retry, press \nthe 'Restart'-Button in the Options-Tab!" ,"Lost!");
}
}
private void scrollbar_Wheat_Scroll(object sender, ScrollEventArgs e)
{
button_buyWheat.Text = "Buy " + scrollbar_Wheat.Value + " wheat";
button_sellWheat.Text = "Sell " + scrollbar_Wheat.Value + " wheat";
label_buyWheat.Text = "...for " + price_buyWheat * scrollbar_Wheat.Value + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat * scrollbar_Wheat.Value + " gold.";
if ((scrollbar_Wheat.Value * price_buyWheat) >= Gold)
{
button_buyWheat.Enabled = false;
}
else button_buyWheat.Enabled = !false;
}
private void button_buyWheat_Click(object sender, EventArgs e)
{
Gold -= scrollbar_Wheat.Value * price_buyWheat;
Wheat += scrollbar_Wheat.Value;
label_Wheat.Text = "Wheat: " + Wheat;
label_Gold.Text = "Gold: " + Gold;
if ((scrollbar_Wheat.Value * price_buyWheat) >= Gold)
{
button_buyWheat.Enabled = false;
}
else button_buyWheat.Enabled = !false;
}
private void button_sellWheat_Click(object sender, EventArgs e)
{
Gold += scrollbar_Wheat.Value * price_sellWheat;
Wheat -= scrollbar_Wheat.Value;
label_Wheat.Text = "Wheat: " + Wheat;
label_Gold.Text = "Gold: " + Gold;
}
private void scrollbar_Fields_Scroll(object sender, ScrollEventArgs e)
{
button_buyFields.Text = "Buy " + scrollbar_Fields.Value + " fields";
button_sellFields.Text = "Sell " + scrollbar_Fields.Value + " fields";
label_buyFields.Text = "...for " + price_buyFields * scrollbar_Fields.Value + " gold.";
label_sellFields.Text = "...for " + price_sellFields * scrollbar_Fields.Value + " gold.";
if ((scrollbar_Fields.Value * price_buyFields) >= Gold)
{
button_buyFields.Enabled = false;
}
else button_buyFields.Enabled = !false;
}
private void button_buyFields_Click(object sender, EventArgs e)
{
Gold -= scrollbar_Fields.Value * price_buyFields;
Fields += scrollbar_Fields.Value;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
if ((scrollbar_Fields.Value * price_buyFields) >= Gold)
{
button_buyFields.Enabled = false;
}
else button_buyFields.Enabled = !false;
}
private void button_sellFields_Click(object sender, EventArgs e)
{
Gold += scrollbar_Fields.Value * price_sellFields;
Fields -= scrollbar_Fields.Value;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
}
private void button_Style_Click(object sender, EventArgs e)
{
metroStyleManager1.Theme = metroStyleManager1.Theme == MetroThemeStyle.Dark ? MetroThemeStyle.Light : MetroThemeStyle.Dark;
this.Theme = metroStyleManager1.Theme == MetroThemeStyle.Dark ? MetroThemeStyle.Light : MetroThemeStyle.Dark;
}
private void button_Restart_Click(object sender, EventArgs e)
{
timerWheat.Stop();
timerFields.Stop();
progressWar.Stop();
timerPrices.Stop();
timerNewPrices.Stop();
timerEvents.Stop();
progressBarTimer.Stop();
timeProgress.Value = 0;
timeProgress2.Value = 0;
timeWar.Value = 0;
Wheat = 1000;
People = 2;
Fields = 1;
PeopleInWar = 0;
Gold = 200;
price_buyWheat = 5;
price_sellWheat = 3;
price_buyFields = 320;
price_sellFields = 160;
timerWheat.Start();
timerEvents.Start();
timerFields.Start();
progressBarTimer.Start();
timerPrices.Start();
timerNewPrices.Start();
label_Wheat.Text = "Wheat: " + Wheat;
label_People.Text = "People: " + People;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
label_buyWheat.Text = "...for " + price_buyWheat + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat + " gold.";
label_buyFields.Text = "...for " + price_buyWheat + " gold.";
label_sellFields.Text = "...for " + price_sellWheat + " gold.";
}
private void button_DifficultyEasy_Click(object sender, EventArgs e)
{
timerWheat.Stop();
timerFields.Stop();
progressWar.Stop();
timerPrices.Stop();
timerNewPrices.Stop();
timerEvents.Stop();
progressBarTimer.Stop();
timeProgress.Value = 0;
timeProgress2.Value = 0;
timeWar.Value = 0;
Wheat = 1250;
People = 2;
Fields = 2;
PeopleInWar = 0;
Gold = 200;
price_buyWheat = 5;
price_sellWheat = 3;
price_buyFields = 320;
price_sellFields = 160;
timerWheat.Start();
timerEvents.Start();
timerFields.Start();
progressBarTimer.Start();
timerPrices.Start();
timerNewPrices.Start();
label_Wheat.Text = "Wheat: " + Wheat;
label_People.Text = "People: " + People;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
label_buyWheat.Text = "...for " + price_buyWheat + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat + " gold.";
label_buyFields.Text = "...for " + price_buyWheat + " gold.";
label_sellFields.Text = "...for " + price_sellWheat + " gold.";
}
private void button_DifficultyNormal_Click(object sender, EventArgs e)
{
timerWheat.Stop();
timerFields.Stop();
progressWar.Stop();
timerPrices.Stop();
timerNewPrices.Stop();
timerEvents.Stop();
progressBarTimer.Stop();
timeProgress.Value = 0;
timeProgress2.Value = 0;
timeWar.Value = 0;
Wheat = 1000;
People = 2;
Fields = 1;
PeopleInWar = 0;
Gold = 200;
price_buyWheat = 5;
price_sellWheat = 3;
price_buyFields = 320;
price_sellFields = 160;
timerWheat.Start();
timerEvents.Start();
timerFields.Start();
progressBarTimer.Start();
timerPrices.Start();
timerNewPrices.Start();
label_Wheat.Text = "Wheat: " + Wheat;
label_People.Text = "People: " + People;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
label_buyWheat.Text = "...for " + price_buyWheat + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat + " gold.";
label_buyFields.Text = "...for " + price_buyWheat + " gold.";
label_sellFields.Text = "...for " + price_sellWheat + " gold.";
}
private void button_DifficultyHard_Click(object sender, EventArgs e)
{
timerWheat.Stop();
timerFields.Stop();
progressWar.Stop();
timerPrices.Stop();
timerNewPrices.Stop();
timerEvents.Stop();
progressBarTimer.Stop();
timeProgress.Value = 0;
timeProgress2.Value = 0;
timeWar.Value = 0;
Wheat = 750;
People = 2;
Fields = 1;
PeopleInWar = 0;
Gold = 200;
price_buyWheat = 5;
price_sellWheat = 3;
price_buyFields = 320;
price_sellFields = 160;
timerWheat.Start();
timerEvents.Start();
timerFields.Start();
progressBarTimer.Start();
timerPrices.Start();
timerNewPrices.Start();
label_Wheat.Text = "Wheat: " + Wheat;
label_People.Text = "People: " + People;
label_Fields.Text = "Fields: " + Fields;
label_Gold.Text = "Gold: " + Gold;
label_PeopleInWar.Text = "In War: " + PeopleInWar;
label_buyWheat.Text = "...for " + price_buyWheat + " gold.";
label_sellWheat.Text = "...for " + price_sellWheat + " gold.";
label_buyFields.Text = "...for " + price_buyWheat + " gold.";
label_sellFields.Text = "...for " + price_sellWheat + " gold.";
}
private void link_Source_Click(object sender, EventArgs e)
{
Process.Start("http://github.com/pixeldesu/farminggame");
}
}
}
Form1.resx 0 → 100644
<?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=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>
<metadata name="timerWheat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>183, 17</value>
</metadata>
<metadata name="metroStyleManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>43</value>
</metadata>
</root>
\ No newline at end of file
LICENSE 0 → 100644
This diff is collapsed.
File added
File added
File added
Program.cs 0 → 100644
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace FarmingGame
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("FarmingGame")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FarmingGame")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("e6800172-93ef-4631-a6ac-1c34cace15a8")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.34003
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FarmingGame.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[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>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FarmingGame.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?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>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.34003
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FarmingGame.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.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;
}
}
}
}
<?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>
README.md 0 → 100644
FarmingGame (alpha)
===================
licensed under aGPLv3
About
-----
FarmingGame is a simple, form-based game where your goal is to survive, or at least keep up the "Wheat"-Counter.
How can I win the game?
-----------------------
You can't win, you just can lose. The only way of "winning" currently is reaching an integer overflow.
How can I keep up the wheat-counter?
------------------------------------
- Wait for random events, they can be helpful, even if they sound bad!
- Sell wheat and buy fields.
Known Bugs/Needed Improvements
------------------------------
- Rewrite the price calculation to be way harder
- The changing of the styles only works if you click the button twice
Used 3rd-party Elements
-----------------------
(winforms-modernui)[https://github.com/viperneo/winforms-modernui] by viperneo
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment