diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3420dec --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +################################################################################ +# This .gitignore file was automatically created by Microsoft(R) Visual Studio. +################################################################################ + +/Gola2/bin +/Gola2/obj +.vs +*.db diff --git a/Gola2.sln b/Gola2.sln new file mode 100644 index 0000000..26e76f0 --- /dev/null +++ b/Gola2.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.2002 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gola2", "Gola2\Gola2.csproj", "{E05E2986-BC10-4A5E-9306-DF69487A5121}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E05E2986-BC10-4A5E-9306-DF69487A5121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E05E2986-BC10-4A5E-9306-DF69487A5121}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E05E2986-BC10-4A5E-9306-DF69487A5121}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E05E2986-BC10-4A5E-9306-DF69487A5121}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9CF37F0E-B7C7-45CD-9ED1-48050432B42D} + EndGlobalSection +EndGlobal diff --git a/Gola2/Actor.cs b/Gola2/Actor.cs new file mode 100644 index 0000000..883fe30 --- /dev/null +++ b/Gola2/Actor.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Gola2 +{ + public abstract class Actor + { + + private PerPixelAlphaForm form = new PerPixelAlphaForm(); + private bool alive = true; + private PointF position; + + #region Instance management + protected Actor() + { + ActorEngine.AddActor(this); + form.Show(); + } + + ~Actor() + { + Kill(); + } + + public virtual void Kill() + { + if (alive) + ActorEngine.RemoveActor(this); + alive = false; + } + #endregion + + #region Lifecycle + + protected abstract void Step(); + + protected virtual void Update() + { + form.SetPosition(new Point((int)position.X, (int)position.Y)); + } + + internal void ExecuteActor() + { + Step(); + Update(); + } + #endregion + + #region Graphigs management + protected void SetBitmap(Bitmap bmp) + { + form.SelectBitmap(bmp); + } + #endregion + + #region Utilities (Static) + + public static int rnd(int min, int max) + { + return Random.Next(min, max); + } + + public static float rndf() + { + return (float)Random.NextDouble(); + } + + public static float rndf(float max) + { + return rndf() * max; + } + + public static float rndf(float min, float max) + { + return min + rndf(max - min); + } + + #endregion + + #region Utilities + + public bool IsNearestTo(Actor a, float distance) + { + return (Math.Pow(X - a.X, 2) + Math.Pow(Y - a.Y, 2)) < (distance * distance); + } + + #endregion + + public PointF Position { get => position; set => position = value; } + public float X { get => position.X; set => position.X = value; } + public float Y { get => position.Y; set => position.Y = value; } + + public Screen Screen => form.Screen; + public static Random Random => ActorEngine.Random; + } +} diff --git a/Gola2/ActorEngine.cs b/Gola2/ActorEngine.cs new file mode 100644 index 0000000..ba064d8 --- /dev/null +++ b/Gola2/ActorEngine.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; + +namespace Gola2 +{ + public static class ActorEngine + { + private static Random random = new Random(); + private static List actors = new List(); + private static Thread t; + private static bool running; + + internal static void AddActor(Actor a) + { + lock (actors) + actors.Add(a); + } + + internal static void RemoveActor(Actor a) + { + lock (actors) + actors.Remove(a); + } + + public static void Start() + { + if (t == null) + { + running = true; + t = new Thread(new ThreadStart(EngineLoop)); + t.Start(); + } + } + + public static void Stop() + { + if (t != null) + { + lock (t) + running = false; + t.Join(); + t = null; + } + } + + public static Actor[] GetActors() + { + lock (actors) + return actors.ToArray(); + } + + public static T[] GetActors() where T : Actor + { + List lst = new List(); + lock (actors) + foreach (Actor a in actors) + if (a is T) + lst.Add((T)a); + return lst.ToArray(); + } + + private static void EngineLoop() + { + bool alive = true; + while (alive) + { + EngineStep(); + Thread.Sleep(1); + lock (t) + alive = running; + } + } + + private static void EngineStep() + { + Actor[] actoring = GetActors(); + foreach (Actor a in actoring) + { + a.ExecuteActor(); + } + } + + public static Random Random => random; + } +} diff --git a/Gola2/Gola.cs b/Gola2/Gola.cs new file mode 100644 index 0000000..52413b8 --- /dev/null +++ b/Gola2/Gola.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Gola2 +{ + class Gola:Actor + { + private const float GRAV = 0.01f; + private PointF force = new Point(0, 0); + private float elasticity = 0.8f; + private float nofriction = 0.99f; + private int size = 64; + + public Gola() + { + SetBitmap(Properties.Resources.ball); + Y = ScreenBottom; + X = rndf(ScreenLeft,ScreenRight); + force.Y = -rndf(5); + force.X = rndf(-3, 3); + } + + protected override void Step() + { + X += force.X; + Y += force.Y; + force.Y += GRAV; + CheckBounds(); + CheckCollision(); + } + + private void CheckBounds() + { + if (Y > ScreenBottom) + { + Y = ScreenBottom; + force.Y = force.Y * -elasticity; + force.X *= nofriction; + } + if (Y < ScreenTop) + { + Y = ScreenTop; + force.Y = force.Y * -elasticity; + } + if (X > ScreenRight) + { + X = ScreenRight; + force.X = force.X * -elasticity; + } + if (X < ScreenLeft) + { + X = ScreenLeft; + force.X = force.X * -elasticity; + } + } + + private void CheckCollision() + { + Gola[] golas = ActorEngine.GetActors(); + foreach(Gola g in golas) + { + if (g == this) + continue; + if (IsNearestTo(g, size)) + { + force.X = rndf(-3,3); + force.Y = -5; + } + } + } + + private int ScreenLeft => Screen.WorkingArea.Left; + private int ScreenRight => Screen.WorkingArea.Right - size; + private int ScreenTop => Screen.WorkingArea.Top; + private int ScreenBottom => Screen.WorkingArea.Bottom - size; + } +} diff --git a/Gola2/Gola2.csproj b/Gola2/Gola2.csproj new file mode 100644 index 0000000..ec308ac --- /dev/null +++ b/Gola2/Gola2.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {E05E2986-BC10-4A5E-9306-DF69487A5121} + WinExe + Gola2 + Gola2 + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + Form + + + + + MainForm.cs + + + PerPixelAlphaForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Gola2/MainForm.Designer.cs b/Gola2/MainForm.Designer.cs new file mode 100644 index 0000000..e71ab4f --- /dev/null +++ b/Gola2/MainForm.Designer.cs @@ -0,0 +1,87 @@ +namespace Gola2 +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(12, 12); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Start"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(93, 12); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Create Ball"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(174, 12); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 2; + this.button3.Text = "Stop"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(354, 49); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "MainForm"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + } +} \ No newline at end of file diff --git a/Gola2/MainForm.cs b/Gola2/MainForm.cs new file mode 100644 index 0000000..5d09f2e --- /dev/null +++ b/Gola2/MainForm.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Gola2 +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + ActorEngine.Start(); + } + + private void button3_Click(object sender, EventArgs e) + { + ActorEngine.Stop(); + } + + private void button2_Click(object sender, EventArgs e) + { + new Gola(); + } + } +} diff --git a/Gola2/MainForm.resx b/Gola2/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Gola2/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Gola2/PerPixelAlphaForm.cs b/Gola2/PerPixelAlphaForm.cs new file mode 100644 index 0000000..ee65114 --- /dev/null +++ b/Gola2/PerPixelAlphaForm.cs @@ -0,0 +1,243 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Drawing.Imaging; +using System.Runtime.InteropServices; + +namespace Gola2 +{ + public partial class PerPixelAlphaForm : Form + { + public PerPixelAlphaForm() + { + FormBorderStyle = FormBorderStyle.None; + ShowInTaskbar = false; + //StartPosition = FormStartPosition.CenterScreen; + Load += PerPixelAlphaForm_Load; + InitActor(); + } + + #region Actor management + private delegate void SetPositionDelegate(System.Drawing.Point position); + + private Screen currentScreen; + + private void InitActor() + { + currentScreen = Screen.FromControl(this); + } + + public void SetPosition(System.Drawing.Point position) + { + if (InvokeRequired) + Invoke((Action)delegate () { SetPosition(position); }); + else + { + Location = position; + currentScreen = Screen.FromControl(this); + } + } + + public Screen Screen => currentScreen; + #endregion + + void PerPixelAlphaForm_Load(object sender, EventArgs e) + { + TopMost = true; + } + + protected override CreateParams CreateParams + { + get + { + // Add the layered extended style (WS_EX_LAYERED) to this window. + CreateParams createParams = base.CreateParams; + if (!DesignMode) + createParams.ExStyle |= WS_EX_LAYERED; + return createParams; + } + } + /// + /// Let Windows drag this window for us (thinks its hitting the title + /// bar of the window) + /// + /// + protected override void WndProc(ref Message message) + { + if (message.Msg == WM_NCHITTEST) + { + // Tell Windows that the user is on the title bar (caption) + message.Result = (IntPtr)HTCAPTION; + } + else + { + base.WndProc(ref message); + } + } + /// + /// + /// + /// + public void SelectBitmap(Bitmap bitmap) + { + SelectBitmap(bitmap, 255); + } + /// + /// + /// + /// + /// + /// + /// + /// Specifies an alpha transparency value to be used on the entire source + /// bitmap. The SourceConstantAlpha value is combined with any per-pixel + /// alpha values in the source bitmap. The value ranges from 0 to 255. If + /// you set SourceConstantAlpha to 0, it is assumed that your image is + /// transparent. When you only want to use per-pixel alpha values, set + /// the SourceConstantAlpha value to 255 (opaque). + /// + public void SelectBitmap(Bitmap bitmap, int opacity) + { + // Does this bitmap contain an alpha channel? + if (bitmap.PixelFormat != PixelFormat.Format32bppArgb) + { + throw new ApplicationException("The bitmap must be 32bpp with alpha-channel."); + } + + // Get device contexts + IntPtr screenDc = GetDC(IntPtr.Zero); + IntPtr memDc = CreateCompatibleDC(screenDc); + IntPtr hBitmap = IntPtr.Zero; + IntPtr hOldBitmap = IntPtr.Zero; + + try + { + // Get handle to the new bitmap and select it into the current + // device context. + hBitmap = bitmap.GetHbitmap(Color.FromArgb(0)); + hOldBitmap = SelectObject(memDc, hBitmap); + + // Set parameters for layered window update. + Size newSize = new Size(bitmap.Width, bitmap.Height); + Point sourceLocation = new Point(0, 0); + Point newLocation = new Point(this.Left, this.Top); + BLENDFUNCTION blend = new BLENDFUNCTION(); + blend.BlendOp = AC_SRC_OVER; + blend.BlendFlags = 0; + blend.SourceConstantAlpha = (byte)opacity; + blend.AlphaFormat = AC_SRC_ALPHA; + + // Update the window. + UpdateLayeredWindow( + this.Handle, // Handle to the layered window + screenDc, // Handle to the screen DC + ref newLocation, // New screen position of the layered window + ref newSize, // New size of the layered window + memDc, // Handle to the layered window surface DC + ref sourceLocation, // Location of the layer in the DC + 0, // Color key of the layered window + ref blend, // Transparency of the layered window + ULW_ALPHA // Use blend as the blend function + ); + } + finally + { + // Release device context. + ReleaseDC(IntPtr.Zero, screenDc); + if (hBitmap != IntPtr.Zero) + { + SelectObject(memDc, hOldBitmap); + DeleteObject(hBitmap); + } + DeleteDC(memDc); + } + } + #region Native Methods and Structures + + const Int32 WS_EX_LAYERED = 0x80000; + const Int32 HTCAPTION = 0x02; + const Int32 WM_NCHITTEST = 0x84; + const Int32 ULW_ALPHA = 0x02; + const byte AC_SRC_OVER = 0x00; + const byte AC_SRC_ALPHA = 0x01; + + [StructLayout(LayoutKind.Sequential)] + struct Point + { + public Int32 x; + public Int32 y; + + public Point(Int32 x, Int32 y) + { this.x = x; this.y = y; } + } + + [StructLayout(LayoutKind.Sequential)] + struct Size + { + public Int32 cx; + public Int32 cy; + + public Size(Int32 cx, Int32 cy) + { this.cx = cx; this.cy = cy; } + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct ARGB + { + public byte Blue; + public byte Green; + public byte Red; + public byte Alpha; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct BLENDFUNCTION + { + public byte BlendOp; + public byte BlendFlags; + public byte SourceConstantAlpha; + public byte AlphaFormat; + } + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, + ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pprSrc, + Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags); + + [DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] + static extern IntPtr CreateCompatibleDC(IntPtr hDC); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + static extern IntPtr GetDC(IntPtr hWnd); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); + + [DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool DeleteDC(IntPtr hdc); + + [DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] + static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); + + [DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool DeleteObject(IntPtr hObject); + + #endregion + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // PerPixelAlphaForm + // + this.ClientSize = new System.Drawing.Size(284, 261); + this.Name = "PerPixelAlphaForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.ResumeLayout(false); + + } + } +} diff --git a/Gola2/PerPixelAlphaForm.resx b/Gola2/PerPixelAlphaForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Gola2/PerPixelAlphaForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Gola2/Program.cs b/Gola2/Program.cs new file mode 100644 index 0000000..110352a --- /dev/null +++ b/Gola2/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Gola2 +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/Gola2/Properties/AssemblyInfo.cs b/Gola2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..75ebf69 --- /dev/null +++ b/Gola2/Properties/AssemblyInfo.cs @@ -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("Gola2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Gola2")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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("e05e2986-bc10-4a5e-9306-df69487a5121")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Gola2/Properties/Resources.Designer.cs b/Gola2/Properties/Resources.Designer.cs new file mode 100644 index 0000000..aee73fb --- /dev/null +++ b/Gola2/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Gola2.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gola2.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ball { + get { + object obj = ResourceManager.GetObject("ball", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Gola2/Properties/Resources.resx b/Gola2/Properties/Resources.resx new file mode 100644 index 0000000..03ac2fd --- /dev/null +++ b/Gola2/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\ball.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Gola2/Properties/Settings.Designer.cs b/Gola2/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f793d96 --- /dev/null +++ b/Gola2/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Gola2.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Gola2/Properties/Settings.settings b/Gola2/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Gola2/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Gola2/Resources/ball.png b/Gola2/Resources/ball.png new file mode 100644 index 0000000..b537d6c --- /dev/null +++ b/Gola2/Resources/ball.png Binary files differ diff --git a/res/ball.png b/res/ball.png new file mode 100644 index 0000000..b537d6c --- /dev/null +++ b/res/ball.png Binary files differ