Ejemplo n.º 1
0
        public void updateMorters()
        {
            for (int i = 0; i < morters.Count; i++)
            {
                Morter tempMorter = (Morter)morters[i];

                tempMorter.explotionTime -= 10;

                if (tempMorter.explotionTime == 10)
                {
                    //Before Explotion Exploded Image Will be Shown
                    morterExplotion.Play();

                    tempMorter.explotion();

                    //expanding The Morters Into A Vast Area
                    Morter morter = new Morter();
                    morter.Coordinate    = new Point(tempMorter.getMorter.Location.X - 70, tempMorter.getMorter.Location.Y);
                    morter.explotionTime = tempMorter.explotionTime;
                    morter.explotion();
                    fireMorter(morter);

                    morter               = new Morter();
                    morter.Coordinate    = new Point(tempMorter.getMorter.Location.X + 70, tempMorter.getMorter.Location.Y);
                    morter.explotionTime = tempMorter.explotionTime;
                    morter.explotion();
                    fireMorter(morter);
                }
                else if (tempMorter.explotionTime == 0)
                {
                    //tempMorter.explotion();
                    explode(tempMorter);
                    canvas.Controls.Remove(tempMorter.getMorter);
                    morters.Remove(tempMorter);
                }


                //If Player Is At Down, Morters Will Go Up
                if (isPlayerAtDown)
                {
                    tempMorter.getMorter.Location = new Point(tempMorter.getMorter.Location.X, tempMorter.getMorter.Location.Y - MOVE_AMMOUNT);
                }
                else
                {
                    tempMorter.getMorter.Location = new Point(tempMorter.getMorter.Location.X, tempMorter.getMorter.Location.Y + MOVE_AMMOUNT);
                }

                //if player is Hitted By Morters
                if (GameStatus.isPlayerHited(tempMorter.getMorter, tempMorter.getMorter.Location, isPlayerAtDown))
                {
                    explode(tempMorter);
                    canvas.Controls.Remove(tempMorter.getMorter);
                    morters.Remove(tempMorter);
                    vehicleDamage.Play();
                }
            }

            updateSplinters();
        }
Ejemplo n.º 2
0
        public void fireMorter()
        {
            Morter morter = new Morter();

            fireCoordinate    = new Point(cordinates.X + ((playerCaracter.Width / 2) - (morter.getMorter.Width / 2)), cordinates.Y + ((playerCaracter.Height / 2) - (morter.getMorter.Height / 2))); //coordinate to fire from player
            morter.Coordinate = fireCoordinate;
            morterFiring.fireMorter(morter);

            getMorter--;
        }
Ejemplo n.º 3
0
        private void generateMorter()
        {
            Morter morter = new Morter();


            morter.Coordinate      = new Point(random1.Next(LOWEST_BOUND_X, HIGHEST_BOUND_X), random1.Next(LOWEST_BOUND_Y, HIGHEST_BOUND_Y));
            morter.getMorter.Image = Properties.Resources.morterPlayer1;
            morter.setSize         = new Size(30, 30);
            canvas.Controls.Add(morter.getMorter);
            weapons.Add(morter.getMorter);
            weaponNames.Add(Morter.NAME);
        }
Ejemplo n.º 4
0
        private void explode(Morter tempMorter)
        {
            int i, j;

            if (isPlayerAtDown)
            {
                i = 0; j = 3;
            }
            else
            {
                i = 5; j = 8;
            }

            for ( ; i < j; i++)
            {
                Splinter splinter = new Splinter();
                splinter.setCoordinate = tempMorter.getMorter.Location;
                splinter.movement.Add(Splinter.movementProperties[i, 0]);
                splinter.movement.Add(Splinter.movementProperties[i, 1]);
                splinter.destructionPoint = 100;

                splinters.Add(splinter);
            }
        }
Ejemplo n.º 5
0
 public void fireMorter(Morter obj)
 {
     morters.Add(obj);
     canvas.Controls.Add(obj.getMorter);
 }