Exemplo n.º 1
0
        public Loot(Vector2 position) : base(Assets.PixelB, position)
        {
            _toRemove = false;
            if (Main.CurrentsScreens[0] is ShooterScreen currentScreen)
            {
                _instancePlayer = currentScreen.GetPlayer;
            }
            if (Main.CurrentsScreens[1] is GestionScreen secondCurrentScreen)
            {
                _instanceGestion = secondCurrentScreen;
            }
            Array values = Enum.GetValues(typeof(LootType));

            _type = (LootType)values.GetValue(Utils.RANDOM.Next(values.Length));
            switch (_type)
            {
            case LootType.Sucre:
                _texture = Assets.Sucre;
                break;

            case LootType.Gras:
                _texture = Assets.Gras;
                break;

            case LootType.VitC:
                _texture = Assets.VitC;
                break;
            }
        }
Exemplo n.º 2
0
        public Loot(Vector2 position, LootType type) : base(Assets.PixelB, position)
        {
            _toRemove = false;
            if (Main.CurrentsScreens[0] is ShooterScreen currentScreen)
            {
                _instancePlayer = currentScreen.GetPlayer;
            }
            if (Main.CurrentsScreens[1] is GestionScreen secondCurrentScreen)
            {
                _instanceGestion = secondCurrentScreen;
            }
            _type = type;
            switch (type)
            {
            case LootType.Sucre:
                _texture = Assets.Sucre;
                break;

            case LootType.Gras:
                _texture = Assets.Gras;
                break;

            case LootType.VitC:
                _texture = Assets.VitC;
                break;
            }
            UpdateHitbox(Position);
        }
Exemplo n.º 3
0
 public BodyPart(Rectangle bounds, string name, GestionScreen instance, int index)
 {
     _instance = instance;
     buffer    = index;
     effect    = 0;
     this.name = name;
     Bounds    = bounds;
     textBound = Utils.CreateTexture(Bounds.Width, Bounds.Height, Color.Yellow);
     list      = new List <Anticorps>();
 }
Exemplo n.º 4
0
        public AntiFactory(GestionScreen instance)
        {
            sucre     = vitC = gras = maxSucre = maxGras = maxVitC = 100;
            manager   = new UiManager();
            _instance = instance;
            position  = new Vector2(200, 200);
            texture   = Utils.CreateTexture(1000, 400, Color.Gray);
            Bounds    = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height);
            manager.AddParticle(new UiButton(new Vector2(position.X + 300, position.Y + 100), () => { BuyAnticorps(AntiType.Normal); }, Assets.AddAnti));
            manager.AddParticle(new UiButton(new Vector2(position.X + 300, position.Y + 200), () => { BuyAnticorps(AntiType.Neighbour); }, Assets.AddAnti));
            manager.AddParticle(new UiButton(new Vector2(position.X + 300, position.Y + 300), () => { BuyAnticorps(AntiType.Leader); }, Assets.AddAnti));


            listProgress = new ProgressBar[3];
            sucreBar     = new ProgressBar(new Vector2(position.X + 50, position.Y + 100), 200, 50, Color.Red, maxSucre, true);
            grasBar      = new ProgressBar(new Vector2(position.X + 50, position.Y + 200), 200, 50, Color.Yellow, maxGras, true);
            vitCBar      = new ProgressBar(new Vector2(position.X + 50, position.Y + 300), 200, 50, Color.Green, maxVitC, true);

            listProgress[0] = sucreBar;
            listProgress[1] = grasBar;
            listProgress[2] = vitCBar;
        }