Ejemplo n.º 1
0
        //adds new letter to cnavas
        private void AddLetter(char character)
        {
            letters anyletter = new letters(character, gameCanvas);

            // gameCanvas.Children.Add(anyletter);
            theLetters.Add(anyletter);
            //starts animation timer of to animate letters
            lettersTimer.Start();
        }
Ejemplo n.º 2
0
 private void LetterBoundaries(letters l)
 {
     if (l.shield.X >= gameCanvas.ActualWidth - 50 || l.shield.X <= 1)
     {
         gameCanvas.Children.Remove(l.therectPath);
         gameCanvas.Children.Remove(l);
         theLetters.Remove(l);
     }
     else if (l.shield.Y >= gameCanvas.ActualHeight - 50 || l.shield.Y <= 1)
     {
         gameCanvas.Children.Remove(l.therectPath);
         gameCanvas.Children.Remove(l);
         theLetters.Remove(l);
     }
 }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
0
 private void RemoveLetters(letters l)
 {
     gameCanvas.Children.Remove(l.therectPath);
     gameCanvas.Children.Remove(l);
     theLetters.Remove(l);
 }
Ejemplo n.º 5
0
        private void DisplayLetters(int letterOrder, letters l)
        {
            switch (letterOrder)
            {
            case 1:
                letter1.Text = Convert.ToString(l.letter);
                break;

            case 2:
                letter2.Text = Convert.ToString(l.letter);
                break;

            case 3:
                letter3.Text = Convert.ToString(l.letter);
                break;

            case 4:
                letter4.Text = Convert.ToString(l.letter);
                break;

            case 5:
                letter5.Text = Convert.ToString(l.letter);
                break;

            case 6:
                letter6.Text = Convert.ToString(l.letter);
                break;

            case 7:
                letter7.Text = Convert.ToString(l.letter);
                break;

            case 8:
                letter8.Text = Convert.ToString(l.letter);
                break;

            case 9:
                letter9.Text = Convert.ToString(l.letter);
                break;

            case 10:
                letter10.Text = Convert.ToString(l.letter);
                break;

            case 11:
                letter11.Text = Convert.ToString(l.letter);
                break;

            case 12:
                letter12.Text = Convert.ToString(l.letter);
                break;

            case 13:
                letter13.Text = Convert.ToString(l.letter);
                break;
            }



            // throw new NotImplementedException();
        }