Пример #1
0
        // Constructor
        public Pacman()
        {
            InitializeComponent();

            DependencyInjectionHelper.Init(((MainWindow)Application.Current.MainWindow));
            DependencyInjectionHelper.getGameComponent().inject(this);


            upStartFrame = 6;
            upEndFrame   = 7;

            downStartFrame = 2;
            downEndFrame   = 3;

            leftStartFrame = 4;
            leftEndFrame   = 5;

            rightStartFrame = 0;
            rightEndFrame   = 1;

            defaultStartFrame = 0;
            defaultEndFrame   = 0;

            speed   = 2;
            offsetX = 0;
            offsetY = 0;
        }
Пример #2
0
        public BoardLocation(int pCode)
        {
            InitializeComponent();

            DependencyInjectionHelper.getGameComponent().inject <BoardLocation>(this);

            // Dots can be either normal (1) or special (2)
            if (pCode == 1 || pCode == 2)
            {
                if (pCode == 1)
                {
                    biscuit  = new Dot(1);
                    dotValue = 10;
                }
                else
                {
                    biscuit  = new Dot(2);
                    dotValue = 50;
                }
                bl.Children.Add(biscuit);                // Dynamicall add the dot to our boardlocation object
                biscuit.Visibility = Visibility.Visible; // make it visible
                Canvas.SetTop(biscuit, 0);
                Canvas.SetLeft(biscuit, 0);
            }
        }
Пример #3
0
        private BoardLocation[,] bl;  // Locations on the board - used to contain dots, etc.

        public GameBoard()
        {
            InitializeComponent();

            DependencyInjectionHelper.Init(((MainWindow)Application.Current.MainWindow));
            DependencyInjectionHelper.getGameComponent().inject(this);

            this.Focusable = true;

            bl = new BoardLocation[13, 27];

            ResetBoardLocations();
            PM.StartTimer();
        }