public void Update() { // Rotation aim_dir = Calculate_dir(); if (wep_old != Weapon_settings.arsenal) { Change_wep(); } // Following player body.X = Objects.player.body.X + (Objects.player.body.Width / 2) - (body.Width / 2); body.Y = Objects.player.body.Y + (Objects.player.body.Height / 2) - (body.Height / 2) + 10; wep_old = Weapon_settings.arsenal; }
/// <summary> /// Constructor. /// </summary> /// <param name="texture">Texture for the shop.</param> /// <param name="rec">Rectangle for the shop, position and size</param> /// <param name="weap">Which weapon will be bought, 1 = shotgun, 2 = ak</param> public Shop(Texture2D texture, Rectangle rec, int weap) // weap 1 = shotgun, 2 = ak; { tex = texture; body = rec; // Adds the gun enum that it will change to, the type(which is the string that will be printed) and the price. if (weap == 1) { weapon = Weapon_settings.Wep.Shotgun; type = "SHOTGUN"; price = 600; } else { weapon = Weapon_settings.Wep.Ak; type = "AK"; price = 1200; } }