diff --git a/.vs/WindowsFormsSector/v16/.suo b/.vs/WindowsFormsSector/v16/.suo new file mode 100644 index 0000000..2434c24 Binary files /dev/null and b/.vs/WindowsFormsSector/v16/.suo differ diff --git a/.vs/WindowsFormsSector/v16/Server/sqlite3/db.lock b/.vs/WindowsFormsSector/v16/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/WindowsFormsSector/v16/Server/sqlite3/storage.ide b/.vs/WindowsFormsSector/v16/Server/sqlite3/storage.ide new file mode 100644 index 0000000..69c1cd6 Binary files /dev/null and b/.vs/WindowsFormsSector/v16/Server/sqlite3/storage.ide differ diff --git a/App.config b/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Class1.cs b/Class1.cs new file mode 100644 index 0000000..efbf066 --- /dev/null +++ b/Class1.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + class UIPictureBox : PictureBox + { + //public int + } +} diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..b5d83a4 --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace WindowsFormsSector +{ + partial class Form1 + { + /// + /// 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.components = new System.ComponentModel.Container(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.SuspendLayout(); + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Interval = 16; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick_1); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.AppWorkspace; + this.ClientSize = new System.Drawing.Size(1184, 761); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyisdown); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.keyisup); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Timer timer1; + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..2a52784 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,479 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + public partial class Form1 : Form + { + public bool isS; + public bool isW; + public bool isRight; + public bool isLeft; + public bool isA; + public bool isD; + public bool Fire; + + public int TurnSpeed = 5; + public double ForwardAcceleration = 0.2; + public double Acceleration = 0.1; + public double Drag = 0.02; + public int Enemycount; + public int BulletSpeed=8; + public int PlayerCooldown = 5; + public int Score=0; + + public int PlayerMaxHealth = 10; + + public int index = 1; + + PictureBox HealthBar = new PictureBox(); + + PictureBox Background = new PictureBox(); + + Label HealthPercentage = new Label(); + + Label ScoreLabel = new Label(); + + Button Start = new Button(); + + Button TryAgain = new Button(); + + Button Close = new Button(); + + public Form1() + { + InitializeComponent(); + timer1.Enabled = false; + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + } + + private void Form1_Load(object sender, EventArgs e) + { + InitializePlayer(); + Background.Size = new Size(1200, 800); + Background.BackColor = Color.Black; + Background.Width = 1200; + Background.Height = 800; + CreateUI(); + Random rand = new Random(); + for(int i=1; i <=2; i++) + { + CreateEnemy(rand.Next(0, 1100),0, rand.Next(0, 360)); + } + } + + void ClickedStart(object sender, EventArgs e) + { + timer1.Enabled = true; + this.Controls.Remove(Start); + } + void ClickedTryAgain(object sender, EventArgs e) + { + Application.Restart(); + } + void ClickedClose(object sender, EventArgs e) + { + this.Close(); + } + public void CreateUI() + { + Start.Top = 300; + Start.Left = 500; + Start.Size = new Size(150, 50); + Start.Text = "START"; + Start.Click += ClickedStart; + + TryAgain.Top = 300; + TryAgain.Left = 500; + TryAgain.Size = new Size(100,40); + TryAgain.Text = "Try Again"; + TryAgain.Click += ClickedTryAgain; + + Close.Top = TryAgain.Top + 60; + Close.Left = TryAgain.Left; + Close.Size = new Size(100, 40); + Close.Text = "Close"; + Close.Click += ClickedClose; + + HealthBar.BackColor = Color.FromArgb(0, 255, 0); + HealthBar.Width = 100; + HealthBar.Height = 15; + HealthBar.Left =100; + HealthBar.Top = Background.Bottom -70; + + + HealthPercentage.Top = HealthBar.Top; + HealthPercentage.Left = HealthBar.Left - 100; + HealthPercentage.Text = "Health:" + (PlayerMaxHealth / PlayerMaxHealth*100).ToString()+'%'; + HealthPercentage.Width =95; + HealthPercentage.Font = new Font("Arial", 10, FontStyle.Bold); ; + + ScoreLabel.Top = 10; + ScoreLabel.Left = 10; + ScoreLabel.Font = new Font("Arial",15, FontStyle.Bold); + ScoreLabel.Text = "Score = " + Score.ToString(); + ScoreLabel.Width = 200; + + this.Controls.Add(HealthBar); + this.Controls.Add(HealthPercentage); + this.Controls.Add(ScoreLabel); + this.Controls.Add(Start); + + HealthPercentage.BringToFront(); + + } + + public void InitializePlayer() + { + Ship Player = new Ship(); + Player.Tag = "Player"; + Player.Size = new Size(50, 50); + Player.BackColor = Color.Black; + Player.PositionY = 650; + Player.PositionX = 550; + Player.Top = (int)Player.PositionY; + Player.Left = (int)Player.PositionX; + Player.Health = PlayerMaxHealth; + Player.index = 0; + + Gun PlayerGun = new Gun(); + PlayerGun.Tag = "PlayerGun"; + PlayerGun.Size = new Size(20, 20); + PlayerGun.BackColor = Color.Blue; + PlayerGun.PositionX = Player.PositionX + Player.Width / 2 - PlayerGun.Width / 2; + PlayerGun.PositionY = Player.PositionY - PlayerGun.Height / 2; + PlayerGun.Top = (int)PlayerGun.PositionY; + PlayerGun.Left = (int)PlayerGun.PositionX; + + this.Controls.Add(PlayerGun); + this.Controls.Add(Player); + } + + public void CreateEnemy(int randx,int randy,int angle) + { + Ship Enemy = new Ship(); + Enemy.Tag = "Enemy"; + Enemy.Size = new Size(40, 40); + Enemy.BackColor = Color.DarkRed; + Enemy.PositionX = randx; + Enemy.PositionY = randy; + Enemy.Top = (int)Enemy.PositionY; + Enemy.Left = (int)Enemy.PositionX; + Enemy.index = index; + Enemy.Angle = angle; + Enemy.Health = 5; + + Gun EnemyGun = new Gun(); + EnemyGun.Tag = "EnemyGun"; + EnemyGun.Size = new Size(20, 20); + EnemyGun.BackColor = Color.Black; + EnemyGun.PositionX = Enemy.PositionX + Enemy.Width / 2 - EnemyGun.Width / 2; + EnemyGun.PositionY = Enemy.PositionY - EnemyGun.Height / 2; + EnemyGun.Top = (int)EnemyGun.PositionY; + EnemyGun.Left = (int)EnemyGun.PositionX; + EnemyGun.index = index; + index++; + Enemycount++; + this.Controls.Add(EnemyGun); + this.Controls.Add(Enemy); + } + + public void CreateProjectile(int gunx,int guny,int angle,int speed,double speedx,double speedy,int index) + { + Projectile bullet = new Projectile(); + bullet.Tag = "bullet"; + bullet.Size = new Size(5, 5); + bullet.BackColor = Color.Red; + bullet.PozitionX = gunx - bullet.Width / 2; + bullet.PozitionY = guny - bullet.Height / 2; + bullet.Angle = angle; + bullet.SpeedX = AngleToX(angle) * speed+speedx; + bullet.SpeedY = AngleToY(angle) * speed+speedy; + bullet.Left = (int)bullet.PozitionX; + bullet.Top = (int)bullet.PozitionY; + bullet.index = index; + + this.Controls.Add(bullet); + + bullet.BringToFront(); + } + + private double DegreesToRadians(double angle) + { + double rad; + rad = angle * (Math.PI / 180); + return rad; + } + + private double AngleToX(double angle) + { + double x; + x = Math.Sin(DegreesToRadians(angle)); + return x; + } + + private double AngleToY(double angle) + { + double y; + y = -Math.Cos(DegreesToRadians(angle)); + return y; + } + private void keyisdown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.W) + { + isW = true; + } + if (e.KeyCode == Keys.S) + { + isS = true; + } + if (e.KeyCode == Keys.Left) + { + isLeft = true; + } + if (e.KeyCode == Keys.Right) + { + isRight = true; + } + if(e.KeyCode == Keys.Space) + { + Fire = true; + } + if (e.KeyCode == Keys.A) + { + isA = true; + } + if (e.KeyCode == Keys.D) + { + isD = true; + } + } + + private void keyisup(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.W) + { + isW = false; + } + if (e.KeyCode == Keys.S) + { + isS = false; + } + if (e.KeyCode == Keys.Left) + { + isLeft = false; + } + if (e.KeyCode == Keys.Right) + { + isRight = false; + } + if (e.KeyCode == Keys.Space) + { + Fire = false; + } + if (e.KeyCode == Keys.A) + { + isA = false; + } + if (e.KeyCode == Keys.D) + { + isD = false; + } + } + + private void timer1_Tick_1(object sender, EventArgs e) + { + Random rand = new Random(); + if (Enemycount < 2) CreateEnemy(rand.Next(0, 1100), 0, rand.Next(90, 180)); + foreach (Control x in this.Controls) + { + if (x is Ship) + { + + if (((Ship)x).Left < 0) + { + ((Ship)x).SpeedX = -((Ship)x).SpeedX*0.5; + ((Ship)x).SpeedY = ((Ship)x).SpeedY * 0.3; + ((Ship)x).PositionX = 0; + } + if (((Ship)x).Top < 0) + { + ((Ship)x).SpeedY = -((Ship)x).SpeedY*0.5; + ((Ship)x).SpeedX = ((Ship)x).SpeedX * 0.3; + ((Ship)x).PositionY = 0; + } + if (((Ship)x).Top > 700) + { + ((Ship)x).SpeedY = -((Ship)x).SpeedY*0.5; + ((Ship)x).SpeedX = ((Ship)x).SpeedX * 0.3; + ((Ship)x).PositionY = 700; + } + if (((Ship)x).Left > 1100) + { + ((Ship)x).SpeedX = -((Ship)x).SpeedX*0.5; + ((Ship)x).SpeedY = ((Ship)x).SpeedY * 0.3; + ((Ship)x).PositionX = 1100; + } + + foreach (Control y in this.Controls) + { + if (y is Gun) + { + if (y.Tag == "PlayerGun" && x.Tag == "Player") + { + if (isRight == true) + { + ((Ship)x).Angle = (((Ship)x).Angle + TurnSpeed) % 360; + } + if (isLeft) + { + ((Ship)x).Angle = (((Ship)x).Angle - TurnSpeed) % 360; + } + if (isW) + { + ((Ship)x).SpeedX += AngleToX(((Ship)x).Angle) * ForwardAcceleration; + ((Ship)x).SpeedY += AngleToY(((Ship)x).Angle) * ForwardAcceleration; + } + if (isS) + { + ((Ship)x).SpeedX -= AngleToX(((Ship)x).Angle) * Acceleration; + ((Ship)x).SpeedY -= AngleToY(((Ship)x).Angle) * Acceleration; + } + if (isD) + { + ((Ship)x).SpeedX -= AngleToX(((Ship)x).Angle-90) * Acceleration; + ((Ship)x).SpeedY -= AngleToY(((Ship)x).Angle-90) * Acceleration; + } + if (isA) + { + ((Ship)x).SpeedX -= AngleToX(((Ship)x).Angle + 90) * Acceleration; + ((Ship)x).SpeedY -= AngleToY(((Ship)x).Angle + 90) * Acceleration; + } + if (Fire&&((Gun)y).Cooldown==0) + { + CreateProjectile( + ((Gun)y).Left + ((Gun)y).Width / 2, + ((Gun)y).Top + ((Gun)y).Height / 2, + ((Ship)x).Angle, + BulletSpeed, + ((Ship)x).SpeedX, + ((Ship)x).SpeedY, + ((Ship)x).index + ); + (((Gun)y).Cooldown)=PlayerCooldown; + }else if (((Gun)y).Cooldown>0) + { + ((Gun)y).Cooldown--; + } + ((Ship)x).PositionX += ((Ship)x).SpeedX; + ((Ship)x).PositionY += ((Ship)x).SpeedY; + ((Ship)x).SpeedX -= ((Ship)x).SpeedX * Drag; + ((Ship)x).SpeedY -= ((Ship)x).SpeedY * Drag; + ((Ship)x).Left = (int)((Ship)x).PositionX; + ((Ship)x).Top = (int)((Ship)x).PositionY; + ((Gun)y).Left = ((Ship)x).Left + ((Ship)x).Width / 2 - ((Gun)y).Width / 2 + (int)(AngleToX(((Ship)x).Angle) * 30); + ((Gun)y).Top = ((Ship)x).Top + ((Ship)x).Height / 2 - ((Gun)y).Height / 2 + (int)(AngleToY(((Ship)x).Angle) * 30); + } + if(x.Tag == "Enemy" && y.Tag == "EnemyGun" && ((Ship)x).index == ((Gun)y).index) + { + ((Ship)x).PositionX += ((Ship)x).SpeedX; + ((Ship)x).PositionY += ((Ship)x).SpeedY; + ((Ship)x).SpeedX -= ((Ship)x).SpeedX * Drag; + ((Ship)x).SpeedY -= ((Ship)x).SpeedY * Drag; + ((Ship)x).Left = (int)((Ship)x).PositionX; + ((Ship)x).Top = (int)((Ship)x).PositionY; + ((Gun)y).Left = (int)((Ship)x).PositionX + ((Ship)x).Width / 2 - ((Gun)y).Width / 2 + (int)(AngleToX(((Ship)x).Angle) * 30); + ((Gun)y).Top = (int)((Ship)x).PositionY + ((Ship)x).Height / 2 - ((Gun)y).Height / 2 + (int)(AngleToY(((Ship)x).Angle) * 30); + + ((Ship)x).SpeedX += AngleToX(((Ship)x).Angle) * Acceleration; + ((Ship)x).SpeedY += AngleToY(((Ship)x).Angle) * Acceleration; + + if (((Gun)y).Cooldown > 0) + { + ((Gun)y).Cooldown--; + } + else + { + CreateProjectile( + ((Gun)y).Left + ((Gun)y).Width / 2, + ((Gun)y).Top + ((Gun)y).Height / 2, + ((Ship)x).Angle, + BulletSpeed, + ((Ship)x).SpeedX, + ((Ship)x).SpeedY, + ((Ship)x).index + ); + ((Gun)y).Cooldown = 30; + } + ((Ship)x).Angle += 1; + } + + } + } + }else if(x is Projectile) + { + ((Projectile)x).PozitionX += ((Projectile)x).SpeedX; + ((Projectile)x).PozitionY += ((Projectile)x).SpeedY; + ((Projectile)x).Left = (int)((Projectile)x).PozitionX; + ((Projectile)x).Top = (int)((Projectile)x).PozitionY; + if (!Background.Bounds.IntersectsWith(x.Bounds)) + { + this.Controls.Remove(x); + } + foreach(Control y in this.Controls) + { + if(y is Gun) + { + foreach(Control z in this.Controls) + { + if(z is Ship) + { + if(((Ship)z).index == ((Gun)y).index) + { + if(x.Bounds.IntersectsWith(z.Bounds)&& ((Projectile)x).index!= ((Ship)z).index) + { + this.Controls.Remove(x); + ((Ship)z).Health-=1; + if (((Ship)z).Health < 1){ + this.Controls.Remove(y); + this.Controls.Remove(z); + if (((Ship)z).Tag == "Player") + { + timer1.Enabled = false; + this.Controls.Add(TryAgain); + this.Controls.Add(Close); + } + else + { + Score += 10; + ScoreLabel.Text = "Score = " + Score.ToString(); + Enemycount--; + } + }else if(((Ship)z).Tag == "Player") + { + HealthBar.Width = (((Ship)z).Health*100 / PlayerMaxHealth); + HealthBar.BackColor = Color.FromArgb((int)(255*(double)(1- (double)((Ship)z).Health / PlayerMaxHealth)), (int)(255 * (double)((double)((Ship)z).Health / PlayerMaxHealth)), 0); + HealthPercentage.Text = "Health:" + ((((Ship)z).Health*100 / PlayerMaxHealth)).ToString()+'%'; + }else if(((Ship)z).Tag == "Enemy") + { + ((Ship)z).BackColor = Color.FromArgb((int)(255 * (double)((double)((Ship)z).Health / 5)),(int)(255 * (double)(1 - (double)((Ship)z).Health / 5)),0); + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..1f666f2 --- /dev/null +++ b/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/Gun.cs b/Gun.cs new file mode 100644 index 0000000..e03f27b --- /dev/null +++ b/Gun.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + class Gun : PictureBox + { + public double PositionX { get; set; } + + public double PositionY { get; set; } + + public int Angle { get; set; } + + public int Cooldown { get; set; } + + public int index { get; set; } + } +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..2e5a32c --- /dev/null +++ b/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Projectile.cs b/Projectile.cs new file mode 100644 index 0000000..63e07d5 --- /dev/null +++ b/Projectile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + class Projectile : PictureBox + { + public double PozitionX { get; set; } + + public double PozitionY { get; set; } + + public int Angle { get; set; } + + public double SpeedX { get; set; } + + public double SpeedY { get; set; } + + public int index { get; set; } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0754105 --- /dev/null +++ b/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("WindowsFormsSector")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WindowsFormsSector")] +[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("28189c8f-8f6e-486c-98d7-408cbfda9b63")] + +// 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/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6868a5e --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 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 WindowsFormsSector.Properties +{ + + + /// + /// 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", "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() + { + } + + /// + /// 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 ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsSector.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; + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..40a0d9a --- /dev/null +++ b/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 WindowsFormsSector.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/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Ship.cs b/Ship.cs new file mode 100644 index 0000000..b6a156e --- /dev/null +++ b/Ship.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsSector +{ + class Ship : PictureBox + { + public double PositionX { get; set; } + + public double PositionY { get; set; } + + public int Angle { get; set; } + + public double SpeedX { get; set; } + + public double SpeedY { get; set; } + + public int index { get; set; } + + public int Health { get; set; } + } +} diff --git a/WindowsFormsSector.csproj b/WindowsFormsSector.csproj new file mode 100644 index 0000000..108f8f1 --- /dev/null +++ b/WindowsFormsSector.csproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {28189C8F-8F6E-486C-98D7-408CBFDA9B63} + WinExe + WindowsFormsSector + WindowsFormsSector + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Component + + + Form + + + Form1.cs + + + Component + + + + Component + + + + Component + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/WindowsFormsSector.sln b/WindowsFormsSector.sln new file mode 100644 index 0000000..bc669b2 --- /dev/null +++ b/WindowsFormsSector.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29609.76 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsSector", "WindowsFormsSector.csproj", "{28189C8F-8F6E-486C-98D7-408CBFDA9B63}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28189C8F-8F6E-486C-98D7-408CBFDA9B63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28189C8F-8F6E-486C-98D7-408CBFDA9B63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28189C8F-8F6E-486C-98D7-408CBFDA9B63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28189C8F-8F6E-486C-98D7-408CBFDA9B63}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {108BE853-4B76-43BD-AB71-E0EDA38465D6} + EndGlobalSection +EndGlobal diff --git a/bin/Debug/WindowsFormsSector.exe b/bin/Debug/WindowsFormsSector.exe new file mode 100644 index 0000000..9a714f5 Binary files /dev/null and b/bin/Debug/WindowsFormsSector.exe differ diff --git a/bin/Debug/WindowsFormsSector.exe.config b/bin/Debug/WindowsFormsSector.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/bin/Debug/WindowsFormsSector.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/Debug/WindowsFormsSector.pdb b/bin/Debug/WindowsFormsSector.pdb new file mode 100644 index 0000000..8113ea1 Binary files /dev/null and b/bin/Debug/WindowsFormsSector.pdb differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..4119efa Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..ebe86eb Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/obj/Debug/WindowsFormsSector.Form1.resources b/obj/Debug/WindowsFormsSector.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.Form1.resources differ diff --git a/obj/Debug/WindowsFormsSector.Properties.Resources.resources b/obj/Debug/WindowsFormsSector.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.Properties.Resources.resources differ diff --git a/obj/Debug/WindowsFormsSector.csproj.FileListAbsolute.txt b/obj/Debug/WindowsFormsSector.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..2e50238 --- /dev/null +++ b/obj/Debug/WindowsFormsSector.csproj.FileListAbsolute.txt @@ -0,0 +1,18 @@ +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.csprojAssemblyReference.cache +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.Form1.resources +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.Properties.Resources.resources +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.csproj.GenerateResource.cache +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\bin\Debug\WindowsFormsSector.exe.config +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\bin\Debug\WindowsFormsSector.exe +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\bin\Debug\WindowsFormsSector.pdb +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.exe +C:\Users\crist\source\repos\WindowsFormsSector\WindowsFormsSector\obj\Debug\WindowsFormsSector.pdb +C:\Users\crist\source\repos\WindowsFormsSector\bin\Debug\WindowsFormsSector.exe.config +C:\Users\crist\source\repos\WindowsFormsSector\bin\Debug\WindowsFormsSector.exe +C:\Users\crist\source\repos\WindowsFormsSector\bin\Debug\WindowsFormsSector.pdb +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.csprojAssemblyReference.cache +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.Form1.resources +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.Properties.Resources.resources +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.csproj.GenerateResource.cache +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.exe +C:\Users\crist\source\repos\WindowsFormsSector\obj\Debug\WindowsFormsSector.pdb diff --git a/obj/Debug/WindowsFormsSector.csproj.GenerateResource.cache b/obj/Debug/WindowsFormsSector.csproj.GenerateResource.cache new file mode 100644 index 0000000..9dff7d3 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.csproj.GenerateResource.cache differ diff --git a/obj/Debug/WindowsFormsSector.csprojAssemblyReference.cache b/obj/Debug/WindowsFormsSector.csprojAssemblyReference.cache new file mode 100644 index 0000000..60b0096 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.csprojAssemblyReference.cache differ diff --git a/obj/Debug/WindowsFormsSector.exe b/obj/Debug/WindowsFormsSector.exe new file mode 100644 index 0000000..9a714f5 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.exe differ diff --git a/obj/Debug/WindowsFormsSector.pdb b/obj/Debug/WindowsFormsSector.pdb new file mode 100644 index 0000000..8113ea1 Binary files /dev/null and b/obj/Debug/WindowsFormsSector.pdb differ