Advertisement
Guest User

Untitled

a guest
May 6th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 25.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace KILLEMO3
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         private Label[] meniu = new Label[4];
  16.         private Objector obj = new Objector();
  17.         private TextBox username = new TextBox();
  18.         private ComboBox difficulty = new ComboBox();
  19.         private string[] meniunames;
  20.         private string[] diffnames;
  21.         private string title;
  22.  
  23.         public Form1()
  24.         {
  25.             InitializeComponent();
  26.         }
  27.  
  28.         private void Form1_Load(object sender, EventArgs e)
  29.         {
  30.             PictureBox bg = new PictureBox();
  31.             title = "KILL EMO 3: DON`T LET THEM KILL THEMSELFS! :: By Profas";
  32.             this.Text = title;
  33.             this.FormBorderStyle = FormBorderStyle.FixedDialog;
  34.             this.Size = new Size(645, 570);
  35.             bg = obj.OPictureBox(new Point(0,0), Image.FromFile(@"img/GUI/enter"));
  36.             this.Controls.Add(bg);
  37.  
  38.             meniunames = new string[4] { "- START - ", "- SCORES -", "- ABOUT -", "- EXIT -" };
  39.             diffnames = new string[3] { "Hard", "Normal", "Easy" };
  40.  
  41.             for (int i = 0; i < 4; i++)
  42.             {
  43.                 meniu[i] = obj.OLabel(new Point(50, (i * 50) + 150), Color.Transparent, meniunames[i]);
  44.                 meniu[i].Size = new Size(225, 50);
  45.                 meniu[i].Font = new Font("Tahoma", 28);
  46.                 meniu[i].Cursor = Cursors.Hand;
  47.                 meniu[i].MouseClick += new MouseEventHandler(MeniuClick);
  48.                 meniu[i].MouseEnter += new EventHandler(MeniuEnter);
  49.                 meniu[i].MouseLeave += new EventHandler(MeniuLeave);
  50.                 bg.Controls.Add(meniu[i]);
  51.             }
  52.  
  53.             username = obj.OTextBox(new Point(160, 445), 150, BorderStyle.FixedSingle);
  54.             difficulty = obj.OComboBox(new Point(160, 475), 150, FlatStyle.Flat);
  55.  
  56.             for (int i = 0; i < 3; i++)
  57.                 difficulty.Items.Add(diffnames[i]);
  58.  
  59.             difficulty.SelectedIndex = 1;
  60.  
  61.             username.Font = new Font("Tahoma", 10);
  62.             difficulty.Font = new Font("Tahoma", 10);
  63.  
  64.             bg.Controls.Add(username);
  65.             bg.Controls.Add(difficulty);
  66.         }
  67.  
  68.         #region MeniuClick
  69.         private void MeniuClick(object sender, MouseEventArgs args)
  70.         {
  71.             Label prv = (sender as Label);
  72.  
  73.             if (prv.Text == meniunames[0])
  74.             {
  75.                 if (username.Text != "")
  76.                 {
  77.                     GameEngine game = new GameEngine(this.Location, this.Size, username.Text, difficulty.Text, title);
  78.                     game.StartEngine();
  79.                 }
  80.                 else
  81.                     MessageBox.Show("Enter Your Name.", "n00b");
  82.             }
  83.             else if (prv.Text == meniunames[1])
  84.             {
  85.                 MessageBox.Show("STATISTICS");
  86.             }
  87.             else if (prv.Text == meniunames[2])
  88.             {
  89.                 MessageBox.Show("ABOUT");
  90.             }
  91.             else if (prv.Text == meniunames[3])
  92.                 this.Close();
  93.         }
  94.         #endregion
  95.  
  96.         #region Events
  97.         private void MeniuEnter(object sender, EventArgs args)
  98.         {
  99.             (sender as Label).ForeColor = Color.Red;
  100.         }
  101.  
  102.         private void MeniuLeave(object sender, EventArgs args)
  103.         {
  104.             (sender as Label).ForeColor = Color.Black;
  105.         }
  106.         #endregion
  107.     }
  108.  
  109.     public class BuyEngine : Form
  110.     {
  111.         #region Variable
  112.         private PictureBox bg;
  113.         private Objector obj = new Objector();
  114.         private Button[] player_upgr = new Button[3];
  115.         private Button[] gun_upgr = new Button[6];
  116.         private Button[] other_upgr = new Button[2];
  117.         #endregion
  118.  
  119.         #region BuyEngine
  120.         public BuyEngine(Player player, Guns guns, Levels levels, GameEngine engine)
  121.         {
  122.             bg = obj.OPictureBox(new Point(0, 0), Image.FromFile(@"img/GUI/buygui.jpg"));
  123.             bg.Size = bg.Image.Size;
  124.             this.Controls.Add(bg);
  125.             this.Size = new Size(645, 570);
  126.             this.Text = "It's Time For Some Upgrade! :-)";
  127.  
  128.             string but = "UPGRADE";
  129.  
  130.             for (int i = 0; i < 3; i++)
  131.             {
  132.                 player_upgr[i] = obj.OButton(new Point(250, (i * 21) + 160), new Size(75, 20), Color.Black, but);
  133.                 player_upgr[i].Font = new Font("Tahoma", 7);
  134.                 player_upgr[i].TextAlign = ContentAlignment.TopCenter;
  135.                 player_upgr[i].ForeColor = Color.White;
  136.                 bg.Controls.Add(player_upgr[i]);
  137.             }
  138.  
  139.             for (int i = 0; i < 6; i++)
  140.             {
  141.                 gun_upgr[i] = obj.OButton(new Point(250, (i * 21) + 273), new Size(75, 20), Color.Black, but);
  142.                 gun_upgr[i].Font = new Font("Tahoma", 7);
  143.                 gun_upgr[i].TextAlign = ContentAlignment.TopCenter;
  144.                 gun_upgr[i].ForeColor = Color.White;
  145.                 bg.Controls.Add(gun_upgr[i]);
  146.             }
  147.  
  148.             for (int i = 0; i < 2; i++)
  149.             {
  150.                 other_upgr[i] = obj.OButton(new Point(250, (i * 21) + 445), new Size(75, 20), Color.Black, but);
  151.                 other_upgr[i].Font = new Font("Tahoma", 7);
  152.                 other_upgr[i].TextAlign = ContentAlignment.TopCenter;
  153.                 other_upgr[i].ForeColor = Color.White;
  154.                 bg.Controls.Add(other_upgr[i]);
  155.             }
  156.         }
  157.         ~BuyEngine() { }
  158.         #endregion
  159.     }
  160.  
  161.     public class Guns
  162.     {
  163.         #region Variable
  164.         private const int nr = 5;
  165.         public int[] gun_dmg;
  166.         public int[] gun_bullet;
  167.         public int[] gun_reload;
  168.         public int[] gun_critical;
  169.         public string[] gun_name;
  170.         public string[] gun_sound;
  171.         public string[] gun_image;
  172.         public string[] gun_target;
  173.         public int choosen;
  174.         private Random random;
  175.         #endregion
  176.  
  177.         #region Guns
  178.         public Guns()
  179.         {
  180.             choosen = 0;
  181.             gun_name = new string[nr] { "USP", "Deagle", "AK-47", "Sniper", "Super Lazer" };
  182.             gun_sound = new string[nr] { "usp.wav", "deagle.wav", "ak-47.wav", "sniper.wav", "lazer.wav" };
  183.             gun_image = new string[nr] { "usp.jpg", "deagle.jpg", "ak-47.jpg", "sniper.jpg", "lazer.jpg" };
  184.             gun_target = new string[nr] { "usp.cur", "deagle.cur", "ak-47.cur", "sniper.cur", "lazer.cur" };
  185.             gun_dmg = new int[nr] { 10, 25, 8, 120, 1000 };
  186.             gun_bullet = new int[nr] { 12, 7, 32, 1, 5 };
  187.             gun_reload = new int[nr] { 3, 4, 8, 2, 12 };
  188.             gun_critical = new int[nr] { 5, 25, 30, 50, 80 };
  189.  
  190.             random = new Random(System.Environment.ProcessorCount);
  191.         }
  192.         ~Guns() { }
  193.         #endregion
  194.  
  195.         #region Reload
  196.         public int Reload()
  197.         {
  198.             return gun_reload[choosen];
  199.         }
  200.         #endregion
  201.  
  202.         #region SetSound
  203.         private void SetSound()
  204.         {
  205.         }
  206.         #endregion
  207.  
  208.         #region DoDamage
  209.         public int DoDamage()
  210.         {
  211.             if (CountCritical())
  212.                 return gun_dmg[choosen] * 2;
  213.             else return
  214.                 gun_dmg[choosen];
  215.         }
  216.         #endregion
  217.  
  218.         #region CountCritical
  219.         private bool CountCritical()
  220.         {
  221.             int chance = random.Next(0, 100);
  222.  
  223.             if (chance < gun_critical[choosen])
  224.                 return true;
  225.             else
  226.                 return false;
  227.         }
  228.         #endregion
  229.  
  230.         #region ChooseGun
  231.         public void ChooseGun(string name)
  232.         {
  233.         }
  234.         #endregion
  235.     }
  236.  
  237.     public class Objector
  238.     {
  239.         #region Objector
  240.         public Objector() { }
  241.         ~Objector() { }
  242.         #endregion
  243.  
  244.         #region PictureBox
  245.         public PictureBox OPictureBox(Point location, Image image)
  246.         {
  247.             try
  248.             {
  249.                 PictureBox img = new PictureBox();
  250.                 img.Image = image;
  251.                 img.Location = location;
  252.                 img.Size = img.Image.Size;
  253.  
  254.                 return img;
  255.             }
  256.             catch { return null; }
  257.         }
  258.         #endregion
  259.  
  260.         #region Form
  261.         public Form OForm(Point location, Size size, bool border)
  262.         {
  263.             try
  264.             {
  265.                 Form form = new Form();
  266.  
  267.                 if (border != true)
  268.                     form.FormBorderStyle = FormBorderStyle.None;
  269.  
  270.                 form.Size = size;
  271.                 form.StartPosition = FormStartPosition.Manual;
  272.                 form.Location = location;
  273.  
  274.                 return form;
  275.             }
  276.             catch { return null; }
  277.         }
  278.         #endregion
  279.  
  280.         #region Label
  281.         public Label OLabel(Point location, Color backcolor, string text)
  282.         {
  283.             try
  284.             {
  285.                 Label label = new Label();
  286.                 label.Text = text;
  287.                 label.Location = location;
  288.                 label.BackColor = backcolor;
  289.  
  290.                 return label;
  291.             }
  292.             catch { return null; }
  293.         }
  294.         #endregion
  295.  
  296.         #region Textbox
  297.         public TextBox OTextBox(Point location, int width, BorderStyle borderstyle)
  298.         {
  299.             try
  300.             {
  301.                 TextBox textbox = new TextBox();
  302.                 textbox.Width = width;
  303.                 textbox.Location = location;
  304.                 textbox.BorderStyle = borderstyle;
  305.  
  306.                 return textbox;
  307.             }
  308.             catch { return null; }
  309.         }
  310.         #endregion
  311.  
  312.         #region GroupBox
  313.         public GroupBox OGroupBox(Point location, Size size, string text)
  314.         {
  315.             try
  316.             {
  317.                 GroupBox groupbox = new GroupBox();
  318.                 groupbox.Location = location;
  319.                 groupbox.Size = size;
  320.                 groupbox.Text = text;
  321.  
  322.                 return groupbox;
  323.             }
  324.             catch { return null; }
  325.         }
  326.         #endregion
  327.  
  328.         #region Panel
  329.         public Panel OPanel(Point location, Size size, Color color)
  330.         {
  331.             try
  332.             {
  333.                 Panel panel = new Panel();
  334.                 panel.Location = location;
  335.                 panel.Size = size;
  336.                 panel.BackColor = color;
  337.  
  338.                 return panel;
  339.             }
  340.             catch { return null; }
  341.         }
  342.         #endregion
  343.  
  344.         #region ListBox
  345.         public ListBox OListBox(Point location, Size size, Color color)
  346.         {
  347.             try
  348.             {
  349.                 ListBox listbox = new ListBox();
  350.                 listbox.Location = location;
  351.                 listbox.Size = size;
  352.                 listbox.BackColor = color;
  353.  
  354.                 return listbox;
  355.             }
  356.             catch { return null; }
  357.         }
  358.         #endregion
  359.  
  360.         #region RichTextBox
  361.         public RichTextBox ORichTextBox(Point location, Size size, Color bgcolor, Color fcolor)
  362.         {
  363.             try
  364.             {
  365.                 RichTextBox rich = new RichTextBox();
  366.                 rich.Location = location;
  367.                 rich.Size = size;
  368.                 rich.BackColor = bgcolor;
  369.                 rich.ForeColor = fcolor;
  370.  
  371.                 return rich;
  372.             }
  373.             catch { return null; }
  374.         }
  375.         #endregion
  376.  
  377.         #region Button
  378.         public Button OButton(Point location, Size size, Color bgcolor, string text)
  379.         {
  380.             try
  381.             {
  382.                 Button button = new Button();
  383.                 button.Location = location;
  384.                 button.Size = size;
  385.                 button.BackColor = bgcolor;
  386.                 button.Text = text;
  387.                 button.Cursor = Cursors.Hand;
  388.                 button.FlatStyle = FlatStyle.Flat;
  389.  
  390.                 return button;
  391.             }
  392.             catch { return null; }
  393.         }
  394.         #endregion
  395.  
  396.         #region ComboBox
  397.         public ComboBox OComboBox(Point location, int width, FlatStyle border)
  398.         {
  399.             try
  400.             {
  401.                 ComboBox box = new ComboBox();
  402.                 box.Location = location;
  403.                 box.Width = width;
  404.                 box.FlatStyle = border;
  405.                 box.DropDownStyle = ComboBoxStyle.DropDownList;
  406.  
  407.                 return box;
  408.             }
  409.             catch { return null; }
  410.         }
  411.         #endregion
  412.     }
  413.  
  414.     public class Player
  415.     {
  416.         #region Variable
  417.         public int bullets;
  418.         public int reloading;
  419.         public int money;
  420.         public Guns guns;
  421.         public bool reloaded;
  422.         private string username;
  423.         private PictureBox gun_img = new PictureBox();
  424.         private string gun;
  425.         private int life;
  426.         private Label[] info = new Label[5];
  427.         private PictureBox lifebox;
  428.         private Objector obj = new Objector();
  429.         private GameEngine engine;
  430.         private string[] _info = new string[5];
  431.         private int tick;
  432.         SoundPlayer reload_sound;
  433.         #endregion
  434.  
  435.         #region Player
  436.         public Player(string user, GameEngine gameengine)
  437.         {
  438.             reloaded = true;
  439.             engine = gameengine;
  440.             username = user;
  441.             life = 100;
  442.             money = 50;
  443.             guns = new Guns();
  444.             guns.choosen = Convert.ToInt32(user)-1;
  445.  
  446.             reload_sound = new SoundPlayer(@"sounds/reload.wav");
  447.  
  448.             gun = guns.gun_name[guns.choosen];
  449.             bullets = guns.gun_bullet[guns.choosen];
  450.             reloading = guns.gun_reload[guns.choosen];
  451.  
  452.             gun_img = obj.OPictureBox(new Point(559, 416), Image.FromFile(@"img/guns/" + guns.gun_image[guns.choosen]));
  453.             gameengine.bg.Controls.Add(gun_img);
  454.  
  455.             _info = new string[5] { life.ToString(), money.ToString(), bullets.ToString(), reloading.ToString(), gun };
  456.             Point[] _location = new Point[5] { new Point(300, 405), new Point(320, 498), new Point(485, 402), new Point(508, 425), new Point(465, 445) };
  457.             int[] _fonts = new int[5] { 16, 16, 12, 12, 12 };
  458.            
  459.             for (int i = 0; i < 5; i++)
  460.             {
  461.                 info[i] = obj.OLabel(_location[i], Color.Transparent, _info[i]);
  462.                 info[i].Font = new Font("Tahoma", _fonts[i]);
  463.                 engine.bg.Controls.Add(info[i]);
  464.             }
  465.  
  466.             lifebox = obj.OPictureBox(new Point(208, 443), Image.FromFile(@"img/sprites/life.bmp"));
  467.             engine.bg.Controls.Add(lifebox);
  468.  
  469.             ChangeInfo();
  470.         }
  471.         ~Player() { }
  472.         #endregion
  473.  
  474.         #region ChangeLife
  475.         public void ChangeLife(int count)
  476.         {
  477.             lifebox.Size = new Size((int)(((float)(life -= count) / 100) * 174), lifebox.Height);
  478.             info[0].Text = life.ToString();
  479.  
  480.             if (life <= 0)
  481.             {
  482.                 info[0].Text = "0";
  483.                 engine.GameOver();
  484.             }
  485.         }
  486.         #endregion
  487.  
  488.         #region Reload
  489.         public void Reload()
  490.         {
  491.             ChangeInfo();
  492.             tick = this.guns.gun_reload[guns.choosen];
  493.             Timer reload = new Timer();
  494.             reload.Interval = 1000;
  495.             reload.Tick += new EventHandler(Reloading);
  496.             reload.Enabled = true;  
  497.         }
  498.         private void Reloading(object sender, EventArgs args)
  499.         {
  500.             reload_sound.Play();
  501.  
  502.             reloading = --tick;
  503.             ChangeInfo();
  504.  
  505.             if (tick == 0)
  506.             {
  507.                 reloaded = true;
  508.                 bullets = guns.gun_bullet[guns.choosen];
  509.                 reloading = guns.gun_reload[guns.choosen];
  510.                 ChangeInfo();
  511.                 (sender as Timer).Enabled = false;
  512.                 (sender as Timer).Dispose();
  513.             }
  514.         }
  515.         #endregion
  516.  
  517.         #region ChangeInfo
  518.         public void ChangeInfo()
  519.         {
  520.             string[] change = new string[5] { life.ToString(), money.ToString(), bullets.ToString(), reloading.ToString(), gun };
  521.  
  522.             gun = guns.gun_name[guns.choosen];
  523.  
  524.             for (int i = 0; i < 5; i++)
  525.                 info[i].Text = change[i];
  526.         }
  527.         #endregion
  528.     }
  529.  
  530.     public class GameEngine : Form
  531.     {
  532.         #region Variables
  533.         private Objector obj = new Objector();
  534.         private Timer enginer = new Timer();
  535.         private Timer checker = new Timer();
  536.         private EmoVeryEasy EVECurrent;
  537.         public PictureBox bg = new PictureBox();
  538.         private Random random = new Random();
  539.         private Player player;
  540.         private Levels levels = new Levels();
  541.         #endregion
  542.  
  543.         #region GameEngine
  544.         public GameEngine(Point location, Size size, string user, string diff, string title)
  545.         {
  546.             this.Cursor = new Cursor(@"img/targets/1.cur");
  547.  
  548.             bg = obj.OPictureBox(new Point(0,0), Image.FromFile(@"img/GUI/EGUI.jpg"));
  549.  
  550.             this.Text = title;
  551.             this.Size = size;
  552.             this.Location = location;
  553.             this.FormBorderStyle = FormBorderStyle.FixedDialog;
  554.             this.Controls.Add(bg);
  555.  
  556.             player = new Player(user, this);
  557.  
  558.             BuyEngine buyengine = new BuyEngine(player, player.guns, levels, this);
  559.             buyengine.Show();
  560.  
  561.             enginer.Tick += new EventHandler(EngineON);
  562.             enginer.Enabled = true;
  563.             enginer.Interval = 2000;
  564.             checker.Tick += new EventHandler(CheckerON);
  565.             checker.Enabled = false;
  566.             checker.Interval = 10;
  567.         }
  568.         ~GameEngine() { }
  569.         #endregion
  570.  
  571.         #region CheckerON
  572.         private void CheckerON(object sender, EventArgs args)
  573.         {
  574.         }
  575.         #endregion
  576.  
  577.         #region EngineON
  578.         private void EngineON(object sender, EventArgs args)
  579.         {
  580.             EVECurrent = new EmoVeryEasy(random.Next(1, 290), player);
  581.             bg.Controls.Add(EVECurrent);
  582.             EVECurrent.BringToFront();
  583.         }
  584.         #endregion
  585.  
  586.         #region GameOver
  587.         public void GameOver()
  588.         {
  589.             checker.Enabled = false;
  590.             enginer.Enabled = false;
  591.             MessageBox.Show("GAME IS OVER", "n00b");
  592.         }
  593.         #endregion
  594.  
  595.         #region StartEngine
  596.         public bool StartEngine()
  597.         {
  598.             this.ShowDialog();
  599.  
  600.             return true;
  601.         }
  602.         #endregion
  603.     }
  604.  
  605.     static class Program
  606.     {
  607.         [STAThread]
  608.         static void Main()
  609.         {
  610.             Application.EnableVisualStyles();
  611.             Application.SetCompatibleTextRenderingDefault(false);
  612.             Application.Run(new Form1());
  613.         }
  614.     }
  615.  
  616.     public class Levels
  617.     {
  618.         #region Variable
  619.         #endregion
  620.  
  621.         #region Levels
  622.         public Levels()
  623.         {
  624.         }
  625.         ~Levels() { }
  626.         #endregion
  627.     }
  628.  
  629.     public interface IUnitInfo
  630.     {
  631.         #region IUnitInfo
  632.         void Walk();
  633.         void Die();
  634.         void Suicide();
  635.         int life { get; set; }
  636.         int dmg { get; set; }
  637.         int speed { get; set; }
  638.         int money { get; set; }
  639.         string name { get; set; }
  640.         #endregion
  641.     }
  642.  
  643.     public class GameUnits : PictureBox, IUnitInfo
  644.     {
  645.         #region Variable
  646.         private int _life;
  647.         private int _speed;
  648.         private int _dmg;
  649.         private int _money;
  650.         private string _name;
  651.         private Timer go;
  652.         private SoundPlayer playsound;
  653.         protected Player _player;
  654.         private bool dead;
  655.         #endregion
  656.  
  657.         #region GameUnits
  658.         public GameUnits()
  659.         {
  660.             _life = life;
  661.             _speed = speed;
  662.             _name = name;
  663.             _dmg = dmg;
  664.             _money = money;
  665.             dead = false;
  666.  
  667.             this.MouseClick += new MouseEventHandler(Shoot);
  668.             RNGCryptoServiceProvider gen = new RNGCryptoServiceProvider();
  669.             byte[] random = new byte[3];
  670.             gen.GetBytes(random);
  671.             int rand = Convert.ToInt32(random[0]);
  672.  
  673.             this.Location = new Point(640, rand);
  674.  
  675.             go = new Timer();
  676.             go.Tick += new EventHandler(GoGoGo);
  677.             go.Interval = 10;
  678.             go.Enabled = true;
  679.         }
  680.         ~GameUnits() { }
  681.         #endregion
  682.  
  683.         #region Shoot
  684.         private void Shoot(object sender, MouseEventArgs args)
  685.         {
  686.             if (_player.reloaded)
  687.             {
  688.                 if (_player.bullets == 1)
  689.                 {
  690.                     _player.reloaded = false;
  691.                     _player.Reload();
  692.                 }
  693.  
  694.                 if (_player.bullets > 0)
  695.                 {
  696.                     PictureBox bullet = new PictureBox();
  697.                     Bitmap _bmp = new Bitmap(@"img/sprites/bullet.bmp");
  698.                     _bmp.MakeTransparent(Color.FromArgb(255, 0, 255));
  699.                     bullet.Image = (Image)_bmp;
  700.                     bullet.MouseClick += new MouseEventHandler(BulletClick);
  701.                     bullet.Size = bullet.Image.Size;
  702.                     bullet.Location = args.Location;
  703.                     this.Controls.Add(bullet);
  704.                     _player.bullets--;
  705.                     _player.ChangeInfo();
  706.  
  707.                     LifeCheck();
  708.                     Sounds();
  709.                 }
  710.             }
  711.  
  712.         }
  713.         #endregion
  714.  
  715.         #region BulletClick
  716.         private void BulletClick(object sender, MouseEventArgs args)
  717.         {
  718.             Sounds();
  719.             LifeCheck();
  720.         }
  721.         #endregion
  722.  
  723.         #region LifeCheck
  724.         private void LifeCheck()
  725.         {
  726.             life -= _player.guns.DoDamage();
  727.             if (life <= 0)
  728.                 Die();
  729.         }
  730.         #endregion
  731.  
  732.         #region Sounds
  733.         private void Sounds()
  734.         {
  735.             playsound = new SoundPlayer(@"sounds/" + _player.guns.gun_sound[_player.guns.choosen]);
  736.             playsound.Play();
  737.         }
  738.         #endregion
  739.  
  740.         #region Property
  741.         public int life
  742.         {
  743.             get
  744.             {
  745.                 return _life;
  746.             }
  747.  
  748.             set
  749.             {
  750.                 _life = value;
  751.             }
  752.         }
  753.  
  754.         public int speed
  755.         {
  756.             get
  757.             {
  758.                 return _speed;
  759.             }
  760.  
  761.             set
  762.             {
  763.                 _speed = value;
  764.             }
  765.         }
  766.  
  767.         public string name
  768.         {
  769.             get
  770.             {
  771.                 return _name;
  772.             }
  773.  
  774.             set
  775.             {
  776.                 _name = value;
  777.             }
  778.         }
  779.  
  780.         public int dmg
  781.         {
  782.             get
  783.             {
  784.                 return _dmg;
  785.             }
  786.  
  787.             set
  788.             {
  789.                 _dmg = value;
  790.             }
  791.         }
  792.  
  793.         public int money
  794.         {
  795.             get
  796.             {
  797.                 return _money;
  798.             }
  799.  
  800.             set
  801.             {
  802.                 _money = value;
  803.             }
  804.         }
  805.         #endregion
  806.  
  807.         #region Walk
  808.         public void Walk()
  809.         {
  810.            this.Left -= _speed;
  811.         }
  812.         #endregion
  813.  
  814.         #region Die
  815.         public void Die()
  816.         {
  817.             _player.money += money;
  818.             _player.ChangeInfo();
  819.             go.Enabled = false;
  820.             this.Dispose();
  821.         }
  822.         #endregion
  823.  
  824.         #region Suicide
  825.         public void Suicide()
  826.         {
  827.             _player.ChangeLife(this.dmg);
  828.             this.Dispose();
  829.             go.Enabled = false;
  830.         }
  831.         #endregion
  832.  
  833.         #region GoGoGo
  834.         private void GoGoGo(object sender, EventArgs args)
  835.         {
  836.             if (this.Left >= 170)
  837.                 this.Walk();
  838.             else
  839.                 if (dead != true)
  840.                 {
  841.                     dead = true;
  842.                     this.Suicide();
  843.                 }
  844.         }
  845.         #endregion
  846.     }
  847.  
  848.     public class EmoVeryEasy : GameUnits
  849.     {
  850.         #region EmoVeryEasy
  851.         public EmoVeryEasy(int location, Player player)
  852.         {
  853.             _player = player;
  854.            
  855.             Bitmap bmp = new Bitmap(@"img/emos/emoveryeasy.bmp");
  856.             bmp.MakeTransparent(Color.FromArgb(255, 0, 255));
  857.             this.BackColor = Color.Transparent;
  858.             this.Image = (Image)bmp;
  859.             this.Size = Image.Size;
  860.  
  861.             speed = 1;
  862.             life = 50;
  863.             money = 84;
  864.             dmg = player.guns.gun_dmg[player.guns.choosen];
  865.             name = "1HitKill";
  866.         }
  867.         #endregion
  868.     }
  869.  
  870.     public class EmoEasy : GameUnits
  871.     {
  872.         #region EmoEasy
  873.         public EmoEasy()
  874.         {
  875.         }
  876.         ~EmoEasy() { }
  877.         #endregion
  878.     }
  879.  
  880.     public class EmoNormal : GameUnits
  881.     {
  882.         #region EmoNormal
  883.         public EmoNormal()
  884.         {
  885.         }
  886.         ~EmoNormal() { }
  887.         #endregion
  888.     }
  889.  
  890.     public class EmoHard : GameUnits
  891.     {
  892.         #region EmoHard
  893.         public EmoHard()
  894.         {
  895.         }
  896.         ~EmoHard() { }
  897.         #endregion
  898.     }
  899.  
  900.     public class EmoVeryHard : GameUnits
  901.     {
  902.         #region EmoVeryHard
  903.         public EmoVeryHard()
  904.         {
  905.         }
  906.         ~EmoVeryHard() { }
  907.         #endregion
  908.     }
  909.  
  910.     public class EmoBoss : GameUnits
  911.     {
  912.         #region EmoBoss
  913.         public EmoBoss()
  914.         {
  915.         }
  916.         ~EmoBoss() { }
  917.         #endregion
  918.     }
  919.  
  920.     public class EmoBonus : GameUnits
  921.     {
  922.         #region EmoBonus
  923.         public EmoBonus()
  924.         {
  925.         }
  926.         ~EmoBonus() { }
  927.         #endregion
  928.     }
  929.  
  930.  
  931. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement