Ejemplo n.º 1
0
        void Roll_Dice(object sender, RoutedEventArgs e)
        {
            if (start) {
                //Player must choose piece or nest first
                if (choosen == false)
                {
                    BitmapImage choosePiece = new BitmapImage(new Uri("/images/choose.png", UriKind.Relative));
                    bubble.Source = choosePiece;

                }
                else
                {

                    Button b = e.Source as Button;
                    Dice newDice = new Dice();
                    int number = newDice.roll_dice();
                    BitmapImage Img = new BitmapImage(new Uri("/images/bubble" + number.ToString() + ".png", UriKind.Relative));
                    bubble.Source = Img;
                    BitmapImage theDice = new BitmapImage(new Uri("/images/dice" + number.ToString() + ".jpg", UriKind.Relative));
                    dice.Source = theDice;

                   // Console.WriteLine("Värde x: " + Pieces[2].X + " värde y: " + Pieces[2].Y);
                    Pieces = pieces;
                }
            }
        }