Exemple #1
0
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            if ((dk.Collsion(dk, mega) == true))
            {
                mega.health    -= 4;
                mega.mana      -= 3;
                attackPhase     = false;
                possibleAttacks = false;
                dk.objectX      = dk.x + 100;
                timer           = 0;
                attackSelector  = 0;
                if (mega.health == 0 | dk.health == 0 || lk.health == 0)
                {
                }
            }
            if (possibleAttacks == true && zKey == true || xKey == true || cKey == true || xKey == true || timer > 20)
            {
                timer++;
            }
            switch (OrignalForm.player_Charcter)
            {
            case 1:
                switch (attackSelector)
                {
                case 1:
                    dk.ObjectMove();
                    break;

                case 2:
                    dk.ObjectMove();
                    break;

                case 3:
                    dk.ObjectMove();
                    break;

                case 4:
                    dk.ObjectMove();
                    break;
                }
                break;

            case 2:
                switch (attackSelector)
                {
                case 1:
                    //dk.DeathEyes();
                    break;
                }
                break;

            case 3:
                switch (attackSelector)
                {
                case 1:
                    //dk.DeathEyes();
                    break;
                }
                break;
            }
            Refresh();
        }
Exemple #2
0
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            if (OrignalForm.player_Charcter == 2)
            {
                if (mega.Collsion(aiMega) == true)
                {
                    switch (attackSelector)
                    {
                    case 1:
                        aiMega.health -= 3;
                        mega.mana     -= 2;
                        break;

                    case 2:
                        aiMega.health -= 6;
                        mega.mana     -= 4;
                        break;

                    case 3:
                        aiMega.health -= 9;
                        mega.mana     -= 10;
                        break;

                    case 4:
                        aiMega.health -= 3;
                        mega.mana     -= 3;
                        break;
                    }
                    attackPhase     = false;
                    possibleAttacks = false;
                    mega.objectX    = mega.sizeX + 100;
                    timer           = 0;
                    attackSelector  = 0;
                    if (aiMega.health <= 0 || aiDK.health <= 0 || aiLK.health <= 0)
                    {
                        Form      f = this.FindForm();
                        WinScreen g = new WinScreen();
                        f.Controls.Remove(this);
                        f.Controls.Add(g);
                        g.Location = new Point((this.Width - g.Width) / 2, (this.Height - g.Height) / 2);
                    }
                }
            }
            if (OrignalForm.player_Charcter == 1)
            {
                if ((dk.Collsion(mega) == true))
                {
                    switch (attackSelector)
                    {
                    case 1:
                        aiMega.health -= 3;
                        dk.mana       -= 2;
                        break;

                    case 2:
                        aiMega.health -= 6;
                        dk.mana       -= 4;
                        break;

                    case 3:
                        aiMega.health -= 9;
                        dk.mana       -= 10;
                        break;

                    case 4:
                        aiMega.health -= 3;
                        dk.mana       -= 3;
                        break;
                    }
                    attackPhase     = false;
                    possibleAttacks = false;
                    dk.objectX      = dk.x + 100;
                    timer           = 0;
                    attackSelector  = 0;
                    if (aiMega.health <= 0 || aiDK.health <= 0 || aiLK.health <= 0)
                    {
                        Form      f = this.FindForm();
                        WinScreen g = new WinScreen();
                        f.Controls.Remove(this);
                        f.Controls.Add(g);
                        g.Location = new Point((this.Width - g.Width) / 2, (this.Height - g.Height) / 2);
                    }
                }
            }

            if (possibleAttacks == true && zKey == true || xKey == true || cKey == true || xKey == true || timer > 20)
            {
                timer++;
            }
            switch (OrignalForm.player_Charcter)
            {
            case 1:
                switch (attackSelector)
                {
                case 1:
                    dk.ObjectMove();
                    break;

                case 2:
                    dk.ObjectMove();
                    break;

                case 3:
                    dk.ObjectMove();
                    break;

                case 4:
                    dk.ObjectMove();
                    break;
                }
                break;

            case 2:
                switch (attackSelector)
                {
                case 1:
                    mega.ObjectMove();
                    break;

                case 2:
                    mega.ObjectMove();
                    break;

                case 3:
                    mega.ObjectMove();
                    break;

                case 4:
                    mega.ObjectMove();
                    break;
                }
                break;

            case 3:
                switch (attackSelector)
                {
                case 1:
                    //dk.DeathEyes();
                    break;
                }
                break;
            }
            Refresh();
        }