Exemple #1
0
 public void Update(Player p, NodeManager worker)
 {
     if (!isDisabled)
     {
         //increment cooldown timer
         reload.update();
         if (reload.ring())
         {
             p.ammo++;
             worker.cash += 10+minerals;
             reload.set(rate);
         }
     }
 }
        //public int nodenum()
        //{
        //}
        //Updates the nodes to check for collisions
        public void update(EnemyManager director, Player p)
        {
            LinkedList<Node> Removals = new LinkedList<Node>();

            foreach (Node curr in Nodes)
            {
                if (curr.updateCollision(director))
                {
                    //Destroy the node
                    Removals.AddFirst(curr);
                    nodesRemaining--;
                }

                curr.updateUpgrades(director, p, this);
            }

            foreach (Node curr in Removals)
            {
                Nodes.Remove(curr);
            }
        }
Exemple #3
0
        //private void Load(Game game)
        //{
        //    image = game.Content.Load<Texture2D>("Images/node");
        //    imageBox = new Rectangle(Xpos, Ypos, image.Width, image.Height);
        //}
        public void updateUpgrades(EnemyManager director, Player p, NodeManager worker)
        {
            ResourceRegen.update();
            if (ResourceRegen.ring())
            {
                p.ammo++;
                ResourceRegen.set(timer);
            }

            if (Trait1 != null)
            {
                Trait1.Update(director);
            }

            if (Trait2 != null)
            {
                Trait2.Update(director);
            }

            if (Trait3 != null)
            {
                Trait3.Update(p, worker);
                Trait3.workHarderBy(40);
            }
        }