Exemplo n.º 1
0
        //Updates Granade Activity
        public void updateGranades()
        {
            for (int i = 0; i < granades.Count; i++)
            {
                Granade temp = (Granade)granades[i];

                //Explotion Time Decreasing
                temp.explotionPoint -= 10;

                if (temp.explotionPoint == 10)
                {
                    temp.explotionMode();
                    granadeExplotion.Play();
                }
                else if (temp.explotionPoint == 0)
                {
                    explode(temp);
                    canvas.Controls.Remove(temp.getGranade);
                    granades.Remove(temp);
                }

                //If Player is At down, Granades Will Move Up
                if (isPlayerAtDown)
                {
                    temp.getGranade.Location = new Point(temp.getGranade.Location.X, temp.getGranade.Location.Y - movementAmmount);
                }
                else
                {
                    temp.getGranade.Location = new Point(temp.getGranade.Location.X, temp.getGranade.Location.Y + movementAmmount);
                }
            }

            updateSplinters();
        }
Exemplo n.º 2
0
        public void fireGranade()
        {
            Granade granade = new Granade();

            fireCoordinate             = new Point(cordinates.X + ((playerCaracter.Width / 2) - (granade.getGranade.Width / 2)), cordinates.Y + ((playerCaracter.Height / 2) - (granade.getGranade.Height / 2))); //coordinate to fire from player
            granade.setGranadeLocation = fireCoordinate;
            granade.getPrepared();
            granadeFiring.fireGranade(granade);

            getGranade--;
        }
Exemplo n.º 3
0
        private void explode(Granade explodedGranade)
        {
            for (int i = 0; i < 8; i++)
            {
                Splinter splinter = new Splinter();
                splinter.setCoordinate = explodedGranade.getGranade.Location;
                splinter.movement.Add(Splinter.movementProperties[i, 0]);
                splinter.movement.Add(Splinter.movementProperties[i, 1]);

                splinters.Add(splinter);
            }
        }
Exemplo n.º 4
0
        private void generateGranade()
        {
            Granade granade = new Granade();


            granade.setGranadeLocation = new Point(random1.Next(LOWEST_BOUND_X, HIGHEST_BOUND_X), random1.Next(LOWEST_BOUND_Y, HIGHEST_BOUND_Y));
            granade.getGranade.Image   = Properties.Resources.granadePlayer;
            granade.setsize            = new Size(30, 30);
            granade.getPrepared();
            canvas.Controls.Add(granade.getGranade);
            weapons.Add(granade.getGranade);
            weaponNames.Add(Granade.NAME);
        }
Exemplo n.º 5
0
 public void fireGranade(Granade obj)
 {
     granades.Add(obj);
     canvas.Controls.Add(obj.getGranade);
 }