Click here to Skip to main content
15,892,575 members
Articles / Web Development / ASP.NET

Bubble Breaker

Rate me:
Please Sign up or sign in to vote.
4.82/5 (39 votes)
7 Aug 2009CPOL2 min read 74.9K   2.3K   80  
A good tutorial for beginners to develop games in Silverlight.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using BubbleBreaker.Library;

namespace BubbleBreaker
{
    public partial class GameMode : UserControl
    {

        #region Constructor

        public GameMode()
        {
            InitializeComponent();
        }

        #endregion

        #region Event

        private void btnPlayGame_Click(object sender, RoutedEventArgs e)
        {

            GameLevel level = GameLevel.Beginner;

            if (rbtnIntermediate.IsChecked == true)
            {
                level = GameLevel.Intermediate;
            }
            else if (rbtnAdvance.IsChecked == true)
            {
                level = GameLevel.Advance;
            }

            GameBoard board = new GameBoard(level);

            PageSwitcher ps = ((Canvas)this.Parent).Parent as PageSwitcher;
            ps.SetActivePage(board);

        }

        
        #endregion

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer
Pakistan Pakistan
Passion and positive dedication is essential part of success. I believe on hardworking and sharing knowledge with others. I always try to be a better than I am and think positive for positive result.

My Blogs

My Linked-In Profile

Comments and Discussions