コード例 #1
0
ファイル: FicAccueil.cs プロジェクト: dayxi/Animation
 private void btnCreationBonhomme_Click(object sender, EventArgs e)
 {
     this.sbo   = new Super_Bonhomme(this.TV, 0, 300, 40, 80);
     this.scene = new Decors(this.TV, 0, 0, 0, 0, 0, this.BackColor, this.BackColor);
     this.Part1 = new Act1(this.TV, 0, 0, 0, 0, 0, this.BackColor, this.BackColor);
     this.Part2 = new Act2(this.TV, 0, 0, 0, 0, 0, this.BackColor, this.BackColor);
     this.btnStopDeplacerCTick.Enabled = true;
     this.timerImage.Start();
     v = 6;
     i = 0;
 }
コード例 #2
0
ファイル: FicAccueil.cs プロジェクト: dayxi/Animation
        private void timerImage_Tick(object sender, EventArgs e)
        {
            g.Clear(Color.LightBlue);
            scene.Afficher(g);

            if (i == 0)
            {
                Part1.Afficher(g);
            }

            else
            {
                Part2.Afficher(g);
            }

            if (sbo.X <= this.TV.Bounds.Width * 1 / 3)
            {
                this.sbo.Bouger(v, 0);
                this.sbo.Afficher(g);
                bufferG.Render();

                v++;

                sbo.J++;

                if (sbo.J >= 20)
                {
                    sbo.J = 15;
                }

                if (v > 23)
                {
                    v -= 1;
                }
            }

            else if (sbo.X >= this.TV.Bounds.Width * 1 / 3 && sbo.X < this.TV.Bounds.Width * 3 / 4)
            {
                v = 11;

                this.sbo.accroupis(v, 0, 0);
                this.sbo.Afficher(g);
                bufferG.Render();

                if (sbo.J > 20)
                {
                    sbo.J--;
                }

                if (v > 15)
                {
                    v -= 2;
                }

                else if (sbo.J <= 0)
                {
                    sbo.J = 16;
                }
            }

            else if (sbo.X >= this.TV.Bounds.Width * 3 / 4)
            {
                this.sbo.debout(v, 0, 0);
                v++;
                this.sbo.Afficher(g);
                bufferG.Render();

                if (sbo.J > 20)
                {
                    sbo.J--;
                }

                if (v > 6)
                {
                    v -= 1;
                }

                else if (sbo.J <= 0)
                {
                    sbo.J = 16;
                }
            }

            if (sbo.X >= this.TV.Bounds.Width - 60)
            {
                i++;
                this.sbo = new Super_Bonhomme(this.TV, 0, 230, 40, 80);
                v        = 6;
                this.sbo.accroupis(v, 0, 0);
                this.sbo.Afficher(g);
                bufferG.Render();
            }
        }