public Player() : base(Sorting.Tag, "Player", 1) { Color = Color.Blue; BodyShape.FillColor = Color; MeleeShape = new CircleShape(MeleeRadius, 3); MeleeShape.FillColor = Color; MeleeShape.Origin = new Vector2f(MeleeRadius, MeleeRadius); Position = Game.Bounds.Center; Speed = 100; Health = new Stat(MaxHealth); Weapons[0] = new Minigun(this); Weapons[1] = new Flamer(this); SelectedWeapon = Weapons[0]; IsWeaponUnlocked[0] = true; }
private void SelectWeapon() { for (int i = 0; i < NumKeys.Length; i++) { if (Keyboard.IsKeyPressed(NumKeys[i]) && Weapons[i] != null && IsWeaponUnlocked[i]) { SelectedWeapon = Weapons[i]; } } }