예제 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            errorValidation.Visible  = false;
            errorValidation1.Visible = false;

            errorValidation.Text  = "";
            errorValidation1.Text = "";

            string username = textBox1.Text;
            string password = textBox2.Text;

            if (passwordValidation(password) == "" && usernameValidation(username) == "")
            {
                id = xml.Register(username, password);

                this.Visible = false;

                LaunchForm form = new LaunchForm(id);
                form.ShowDialog();

                this.Close();
            }
            else
            {
                errorValidation.Text  = usernameValidation(username);
                errorValidation1.Text = passwordValidation(password);

                errorValidation.Visible  = true;
                errorValidation1.Visible = true;
            }
        }
예제 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            errorValidation.Visible  = false;
            errorValidation1.Visible = false;

            errorValidation.Text  = "";
            errorValidation1.Text = "";

            string username = textBox1.Text;
            string password = textBox2.Text;

            if (passwordValidation(password) == "" && usernameValidation(username) == "")
            {
                id = xml.Login(username, password);

                if (id != 0)
                {
                    this.Visible = false;

                    LaunchForm form = new LaunchForm(id);
                    form.ShowDialog();

                    this.Close();
                }
                else
                {
                    errorValidation.Text  = "Неправильний логін або пароль";
                    errorValidation1.Text = "Неправильний логін або пароль";

                    errorValidation.Visible  = true;
                    errorValidation1.Visible = true;
                }
            }
            else
            {
                errorValidation.Text  = usernameValidation(username);
                errorValidation1.Text = passwordValidation(password);

                errorValidation.Visible  = true;
                errorValidation1.Visible = true;
            }
        }
예제 #3
0
        private void GameOver()
        {
            characterState = null;

            PictureBox sprite = new PictureBox();

            sprite.Image    = Image.FromFile(pathForCharacterGoBack);
            sprite.SizeMode = PictureBoxSizeMode.StretchImage;
            sprite.Location = new Point(300, 300);
            sprite.Size     = new Size(sizeOfSides, sizeOfSides);

            characterState = new HeroMemento(300, 100, 0, sprite);
            character.RestoreState(characterState);
            characterState = character.SaveState();

            level = 1;
            score = 0;
            timer.Stop();

            enemyTimer.Stop();

            GameOverForm f = new GameOverForm();

            f.ShowDialog();

            if (Data.redirect)
            {
                this.Visible = false;

                LaunchForm form = new LaunchForm(currentUserId);
                form.ShowDialog();

                this.Close();
            }
            else
            {
                GenerateWorld(false);
            }
        }