Example #1
0
        //creates new bullets every time leftButton of the mouse is clicked
        private void gameCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            bullets bullet = new bullets(gameCanvas, thePlayer.temp3, thePlayer.temp4);

            bullet.setAngle(thePlayer.temp1, thePlayer.temp2, thePlayer.temp3, thePlayer.temp4);
            fireBullet(bullet);
            bulletCount += 1;

            //increase everytime bullets if fired
            startshooting++;
        }
Example #2
0
        private void boundaries(bullets b, letters l)
        {
            //if (b.shield.X.Equals(l.shield.X)&& b.shield.Y.Equals(l.shield.Y))
            //{


            //    for (int i=0;i<=getLetter.Length-1;i++)
            //    {
            //        if (l.letter == getLetter[i] && indexLetter == i)
            //        {

            //        }


            //    }

            //    indexLetter++;
            //    bulletCount = 0;
            //    // CountScore();
            //    theLetters.Remove(l);
            //       gameCanvas.Children.Remove(l.therectPath);
            //      gameCanvas.Children.Remove(l);
            //    theBullets.Remove(b);
            //       gameCanvas.Children.Remove(b.theBullet);
            //       gameCanvas.Children.Remove(b.therectPath);

            //}

            if (b.shield.IntersectsWith(l.shield))
            {
                letterOrder++;

                DisplayLetters(letterOrder, l);

                indexLetter++;
                bulletCount = 0;

                theLetters.Remove(l);
                gameCanvas.Children.Remove(l.therectPath);
                gameCanvas.Children.Remove(l);
                theBullets.Remove(b);
                gameCanvas.Children.Remove(b.theBullet);
                gameCanvas.Children.Remove(b.therectPath);
            }
        }
Example #3
0
        private void bulletBoundaries(bullets b)
        {
            if (b.shield.X >= gameCanvas.ActualWidth - 10 || b.shield.X <= 1)
            {
                theBullets.Remove(b);
                gameCanvas.Children.Remove(b.theBullet);
                gameCanvas.Children.Remove(b.therectPath);

                bulletCount = 0;
            }
            else if (b.shield.Y >= gameCanvas.ActualHeight - 10 || b.shield.Y <= 1)
            {
                theBullets.Remove(b);
                gameCanvas.Children.Remove(b.theBullet);
                gameCanvas.Children.Remove(b.therectPath);

                bulletCount = 0;
            }
        }
Example #4
0
 private void fireBullet(bullets b)
 {
     theBullets.Add(b);
 }