Exemple #1
0
        public static void raceRadio_TapEvent_r2(MasterMind mm)
        {
            mm.setCounter(mm.getCounter() == 6 ? 0 : mm.getCounter() + 1);

            switch (mm.getCounter())
            {
                case 0: mm.getRb2().SelectedColor = GHI.Glide.Colors.Red;
                    mm.getRb2().Color = GHI.Glide.Colors.Red;
                    break;
                case 1: mm.getRb2().SelectedColor = GHI.Glide.Colors.Green;
                    mm.getRb2().Color = GHI.Glide.Colors.Green;
                    break;
                case 2: mm.getRb2().SelectedColor = GHI.Glide.Colors.White;
                    mm.getRb2().Color = GHI.Glide.Colors.White;
                    break;
                case 3: mm.getRb2().SelectedColor = GHI.Glide.Colors.Blue;
                    mm.getRb2().Color = GHI.Glide.Colors.Blue;
                    break;
                case 4: mm.getRb2().SelectedColor = GHI.Glide.Colors.Yellow;
                    mm.getRb2().Color = GHI.Glide.Colors.Yellow;
                    break;
                case 5: mm.getRb2().SelectedColor = GHI.Glide.Colors.Orange;
                    mm.getRb2().Color = GHI.Glide.Colors.Orange;
                    break;

            }
            mm.getRb2().Invalidate();
        }
        public static void raceRadio_TapEvent_r1(MasterMind mm)
        {
            mm.setCounter(mm.getCounter() == 6 ? 0 : mm.getCounter() + 1);


            switch (mm.getCounter())
            {
            case 0: mm.getRb1().SelectedColor = GHI.Glide.Colors.Red;
                mm.getRb1().Color             = GHI.Glide.Colors.Red;
                break;

            case 1: mm.getRb1().SelectedColor = GHI.Glide.Colors.Green;
                mm.getRb1().Color             = GHI.Glide.Colors.Green;
                break;

            case 2: mm.getRb1().SelectedColor = GHI.Glide.Colors.White;
                mm.getRb1().Color             = GHI.Glide.Colors.White;
                break;

            case 3: mm.getRb1().SelectedColor = GHI.Glide.Colors.Blue;
                mm.getRb1().Color             = GHI.Glide.Colors.Blue;
                break;

            case 4: mm.getRb1().SelectedColor = GHI.Glide.Colors.Yellow;
                mm.getRb1().Color             = GHI.Glide.Colors.Yellow;
                break;

            case 5: mm.getRb1().SelectedColor = GHI.Glide.Colors.Orange;
                mm.getRb1().Color             = GHI.Glide.Colors.Orange;
                break;
            }
            mm.getRb1().Invalidate();
        }
Exemple #3
0
        // Handlers for left right events from the joystick
        public static void leftEventFired(MasterMind mm)
        {
            if (mm.getCurrentLeftRight() == 1) return;

            mm.setCurrentLeftRight(mm.getCurrentLeftRight() - 1);

            if (mm.getCurrentLeftRight() == 1)
            {
               mm.getRb2().OutlineColor = GHI.Glide.Colors.White;
                mm.getRb2().Invalidate();

                mm.getRb1().OutlineColor = GHI.Glide.Colors.Red;
               mm.getRb1().Invalidate();

            }
            if (mm.getCurrentLeftRight() == 2)
            {
              mm.getRb3().OutlineColor = GHI.Glide.Colors.White;
              mm.getRb3().Invalidate();

                mm.getRb2().OutlineColor = GHI.Glide.Colors.Red;
                mm.getRb2().Invalidate();

            }
            if (mm.getCurrentLeftRight() == 3)
            {

                mm.getRb4().OutlineColor = GHI.Glide.Colors.White;
                mm.getRb4().Invalidate();

                mm.getRb3().OutlineColor = GHI.Glide.Colors.Red;
                mm.getRb3().Invalidate();
            }
        }
        public static void rightEventFired(MasterMind mm)
        {
            if (mm.getCurrentLeftRight() == 4)
            {
                return;
            }
            mm.setCurrentLeftRight(mm.getCurrentLeftRight() + 1);


            if (mm.getCurrentLeftRight() == 2)
            {
                mm.getRb1().OutlineColor = GHI.Glide.Colors.White;
                mm.getRb1().Invalidate();

                mm.getRb2().OutlineColor = GHI.Glide.Colors.Red;
                mm.getRb2().Invalidate();
            }
            if (mm.getCurrentLeftRight() == 3)
            {
                mm.getRb2().OutlineColor = GHI.Glide.Colors.White;
                mm.getRb2().Invalidate();

                mm.getRb3().OutlineColor = GHI.Glide.Colors.Red;
                mm.getRb3().Invalidate();
            }
            if (mm.getCurrentLeftRight() == 4)
            {
                mm.getRb3().OutlineColor = GHI.Glide.Colors.White;
                mm.getRb3().Invalidate();

                mm.getRb4().OutlineColor = GHI.Glide.Colors.Red;
                mm.getRb4().Invalidate();
            }
        }
        //Starts a new Game
        private void startGame(int[] newSolution)
        {
            isGameScreen = true;
            isPlayer2Win = false;

            if (newSolution != null)
            {
                winMasterMind = new MasterMind(newSolution);
            }
            else
            {
                winMasterMind = new MasterMind();
            }

            Glide.MainWindow = winMasterMind.getGameWindow();
            isGameScreen     = true;
            winMasterMind.startNewRow();
        }
        void ProgramStarted()
        {
            Glide.FitToScreen = true;

            //load screen from xml
            mainWindow    = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            winMasterMind = new MasterMind();

            // reference for buttons from first screen
            btn1Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn1Player");
            btn2Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn2Player");

            btn1Player.TintColor = GHI.Glide.Colors.Red;


            //listeners from button clicked
            btn1Player.TapEvent += btn1Player_ButtonPressed;
            btn2Player.TapEvent += btn2Player_ButtonPressed;

            f             = Resources.GetFont(Resources.FontResources.NinaB);
            fontHeight    = f.Height;
            displayHeight = displayTE35.Height;

            // position for joystick
            double xPos = joystick.GetPosition().X;
            double yPos = joystick.GetPosition().Y;

            GT.Timer jt = new GT.Timer(275);

            jt.Tick += jt_Tick;

            joystick.JoystickPressed += joystick_JoystickPressed;
            jt.Start();

            button.ButtonPressed += button_ButtonPressed;

            Glide.MainWindow = mainWindow;
            GlideTouch.Initialize();
        }
Exemple #7
0
        //Starts a new Game
        private void startGame(int[] newSolution)
        {
            isGameScreen = true;
            isPlayer2Win = false;

            if (newSolution != null) winMasterMind = new MasterMind(newSolution);
            else
                winMasterMind = new MasterMind();

            Glide.MainWindow = winMasterMind.getGameWindow();
            isGameScreen = true;
            winMasterMind.startNewRow();
        }
Exemple #8
0
        void ProgramStarted()
        {
            Glide.FitToScreen = true;

            //load screen from xml
            mainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            winMasterMind = new MasterMind();

            // reference for buttons from first screen
            btn1Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn1Player");
            btn2Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn2Player");

            btn1Player.TintColor = GHI.Glide.Colors.Red;

            //listeners from button clicked
            btn1Player.TapEvent += btn1Player_ButtonPressed;
            btn2Player.TapEvent += btn2Player_ButtonPressed;

            f = Resources.GetFont(Resources.FontResources.NinaB);
            fontHeight = f.Height;
            displayHeight = displayTE35.Height;

            // position for joystick
            double xPos = joystick.GetPosition().X;
            double yPos = joystick.GetPosition().Y;
            GT.Timer jt = new GT.Timer(275);

            jt.Tick += jt_Tick;

            joystick.JoystickPressed += joystick_JoystickPressed;
            jt.Start();

            button.ButtonPressed += button_ButtonPressed;

            Glide.MainWindow = mainWindow;
            GlideTouch.Initialize();
        }