예제 #1
0
        private void ChampionModeOn(object sender, MouseButtonEventArgs e)
        {
            typingParams tP = typingParams.getInstance();

            tP.setGameMode("champion");
            this.label5.Content = tP.getGameModeString();
        }
예제 #2
0
        private void NormalMouseMove(object sender, MouseEventArgs e)
        {
            typingParams tP = typingParams.getInstance();

            label7.Foreground      = new SolidColorBrush(Colors.Aqua);
            this.label1.Foreground = new SolidColorBrush(Colors.Blue);
            this.label1.FontWeight = FontWeights.Normal;
            this.label1.Content    = tP.getCurrentPlayerString() +
                                     " Player\nHit Space key!";
            this.label5.Content = tP.getGameModeString();
        }
예제 #3
0
        public MainWindow()
        {
            InitializeComponent();
            this.MainForm.Background = new SolidColorBrush(Colors.AliceBlue);

            typingParams tP = typingParams.getInstance();

            this.label3.Visibility = Visibility.Hidden;
            this.label3.Content    = "Miss!!";

            this.m_typing = new typing();
            initForm(true);

            this.skel.Visibility    = Visibility.Hidden;
            this.yamochi.Visibility = Visibility.Hidden;
            this.label5.Content     = tP.getGameModeString();
            this.label6.Content     = "Easy";
            this.label7.Content     = "Normal";
            this.label8.Content     = "Champion";
        }
예제 #4
0
        private void onKeyDown(object sender, KeyEventArgs e)
        {
            typingParams tP    = typingParams.getInstance();
            String       enter = e.Key.ToString();

            Debug.WriteLine(enter);

            if (this.isGameOver == true)
            {
                if ((enter.Equals("Space") == true) || (enter.Equals("Eacape") == true))
                {
                    this.isGameOver         = false;
                    this.skel.Visibility    = Visibility.Hidden;
                    this.yamochi.Visibility = Visibility.Hidden;

                    tP.setTimerState(false);
                    tP.clearInputTime();

                    initForm(true);
                    this.m_bgRatio           = 0x0;
                    this.label1.Visibility   = Visibility.Visible;
                    this.MainForm.Background = new SolidColorBrush(Colors.AliceBlue);
                    this.label3.Visibility   = Visibility.Hidden;
                    this.label5.Content      = tP.getGameModeString();
                    this.label6.Visibility   = Visibility.Visible;
                    this.label7.Visibility   = Visibility.Visible;
                    this.label8.Visibility   = Visibility.Visible;
                }
                return;
            }

            typingParams.GAME_STATE r_inf = this.m_typing.KeyDown(enter);
            this.MainForm.Background = new SolidColorBrush(Colors.AliceBlue);
            this.label1.Visibility   = Visibility.Visible;
            this.label3.Visibility   = Visibility.Hidden;

            switch (r_inf)
            {
            case typingParams.GAME_STATE.GAME_STARTED:
            {
                String modeStr = tP.getGameModeString();

                tP.randomTargetString();
                tP.championTargetString();

                tP.setFirstChar();

                this.label1.Foreground = new SolidColorBrush(Colors.Blue);
                this.label1.FontWeight = FontWeights.Normal;
                this.label1.FontSize   = 300;
                this.label1.Content    = tP.getViewString();
                this.label6.Visibility = Visibility.Hidden;
                this.label7.Visibility = Visibility.Hidden;
                this.label8.Visibility = Visibility.Hidden;

                if (tP.getGameMode() == typingParams.GAME_MODE.EASY_MODE)
                {
                    this.label2.Content = tP.getCurrentString();
                }

                if (tP.getAorZmode() == true)
                {
                    modeStr += "\n(A → Z)";
                }
                else
                {
                    modeStr += "\n(Z → A)";
                }

                label5.Content = modeStr;

                this.disTimer.Start();
                break;
            }

            case typingParams.GAME_STATE.CONTINUE_INPUT:
            {
                this.label1.Content = tP.getViewString();
                this.label2.Content = tP.getPoolString();
                break;
            }

            case typingParams.GAME_STATE.MISS_ENTER:
            {
                this.label3.Content      = "Miss!!";
                this.label3.FontSize     = 180;
                this.label1.Visibility   = Visibility.Hidden;
                this.label3.Visibility   = Visibility.Visible;
                this.MainForm.Background = new SolidColorBrush(Colors.PaleVioletRed);
                break;
            }

            case typingParams.GAME_STATE.GO_TO_NEXT_PLAYER:
            {
                this.disTimer.Stop();
                this.label1.Content = tP.getViewString();

                String tex = this.m_typing.getTmpGameResult();
                System.Windows.MessageBox.Show(tex, "中間発表");

                this.label3.Visibility = Visibility.Hidden;
                tP.incCurrentPlayer();
                initForm();
                break;
            }

            case typingParams.GAME_STATE.GAME_IS_OVER:
            {
                String resultString = "";
                this.disTimer.Stop();
                this.label1.Content = tP.getViewString();

                resultString = this.m_typing.getGameResult();
                this.m_typing.writeResultDataToFile(resultString);
                System.Windows.MessageBox.Show(resultString,
                                               "結果発表");
                initForm(true);
                this.label5.Content    = tP.getGameModeString();
                this.label6.Visibility = Visibility.Visible;
                this.label7.Visibility = Visibility.Visible;
                this.label8.Visibility = Visibility.Visible;
                break;
            }

            case typingParams.GAME_STATE.TERMINATE_GAME:
            {
                this.disTimer.Stop();

                tP.setTimerState(false);
                tP.clearInputTime();

                initForm(true);
                this.m_bgRatio         = 0x0;
                this.label5.Content    = tP.getGameModeString();
                this.label6.Visibility = Visibility.Visible;
                this.label7.Visibility = Visibility.Visible;
                this.label8.Visibility = Visibility.Visible;
                break;
            }

            default:
                break;
            }
        }