private async void Form1_Load(object sender, EventArgs e) { Players = await GameFacade.GetAllPlayersFromDatabase(); Connect(); Players = await GameFacade.GetAllPlayersFromDatabase(); timer1.Tick += timer1_Tick; timer1.Start(); timer1.Interval = 100; // Composite ---------------------------------------------- var salmas = new Helmet(); var sautuvas = new Pistol(); bazuka.Inventory.Add(sautuvas); bazuka.Inventory.Add(salmas); bazuka.Inventory.Add(bazuka); int i = 0; foreach (var t in bazuka.Inventory) { textBox1.AppendText(t.SayHello() + Environment.NewLine); wpns[i++] = t.SayHello(); } // --------------------------------------------------------- }
public Enemy(int HP, Vector location, int width, int height, Bitmap sprite, Dictionary <string, Bitmap[]> animation, Dictionary <string, Bitmap[]> animationV, Bitmap spriteV, Block[,] map) : base(HP, location, width, height, sprite, animation, animationV, spriteV) { timer.Interval = 1000; timer.Start(); CurrentGun = new Pistol(Properties.Resources.gun, this); Map = map; }
public float angle; // ПОФИКСИТЬ УДАЛЕНИЕ ПУЛЬ!!!!!!!! public Bullet(Entity entity) { isDead = false; location = entity.Location; gun = entity.CurrentGun; var xVel = Math.Cos(gun.angle) * 6 * kostil; var yVel = Math.Sin(gun.angle) * 6 * kostil; velocity = new Vector((int)xVel, (int)yVel); owner = entity; }