コード例 #1
0
 protected override void Draw(GameTime gameTime)
 {
     GraphicsDevice.Clear(Color.White);
     Globals.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
     if (VideoPlayer1.State != MediaState.Stopped)
     {
         VideoTexture1 = VideoPlayer1.GetTexture();
     }
     if (VideoTexture1 != null)
     {
         Globals.spriteBatch.Draw(VideoTexture1, GraphicsDevice.Viewport.Bounds, Color.White);
     }
     if (level == 1)
     {
         gamePlay.Draw();
         cursor.Draw(new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y), new Vector2(0, 0));
         base.Draw(gameTime);
     }
     //if (World.dead) Globals.SoundControl = new SoundControl("endMusic");
     Globals.spriteBatch.End();
 }
コード例 #2
0
        public virtual void Draw(Vector2 OFFSET)
        {
            if (MobDowns.Current < 42 && MobTops.Current < 42 && MobLefts.Current < 42 && MobRights.Current < 42)
            {
                backGround.Draw(OFFSET);
                mainChar.Draw(OFFSET);

                // power
                #region
                power.Draw(OFFSET);
                if (powerCycle >= 500)
                {
                    power01.Draw(OFFSET);
                }
                if (powerCycle >= 700)
                {
                    power02.Draw(OFFSET);
                }
                if (powerCycle >= 900)
                {
                    power03.Draw(OFFSET);
                }
                if (powerCycle >= 1100)
                {
                    power04.Draw(OFFSET);
                }
                if (powerCycle == 1300)
                {
                    flat = true;
                }
                if (flat)
                {
                    if (powerCycle >= 1300)
                    {
                        powerfull01.Draw(OFFSET);
                    }
                    if (powerCycle >= 1320)
                    {
                        powerfull02.Draw(OFFSET);
                    }
                    if (powerCycle >= 1340)
                    {
                        powerfull03.Draw(OFFSET);
                    }
                    if (powerCycle >= 1360)
                    {
                        powerfull04.Draw(OFFSET);
                        isPower    = true;
                        powerCycle = 1320;
                    }
                }
                if (GameGlobals.gameTimePassed % 1670 == 0 && powerCycle > 1300)
                {
                    isPower = false; powerCycle = 0;
                }
                if (GameGlobals.gameTimePassed % 1700 == 0 && powerCycle > 1300)
                {
                    flat = false;
                }
                #endregion

                // draw Mobs
                MobTops.Draw(OFFSET);
                TopBar.Draw(new Vector2(MobTops.pos.X - 70, MobTops.pos.Y - 160));
                if (GameGlobals.gameTimePassed >= 1000)
                {
                    MobDowns.Draw(OFFSET);
                    DownBar.Draw(new Vector2(MobDowns.pos.X - 100, MobDowns.pos.Y - 200));

                    if (GameGlobals.gameTimePassed >= 1500)
                    {
                        MobLefts.Draw(OFFSET);
                        LeftBar.Draw(new Vector2(MobLefts.pos.X - 70, MobLefts.pos.Y - 190));
                    }

                    if (GameGlobals.gameTimePassed >= 2200)
                    {
                        MobRights.Draw(OFFSET);
                        RightBar.Draw(new Vector2(MobRights.pos.X - 70, MobRights.pos.Y - 165));
                    }
                }

                //draw projectile
                for (int i = 0; i < Projectile2Ds.Count; i++)
                {
                    Projectile2Ds[i].Draw(OFFSET);
                }
                if (isPower)
                {
                    for (int i = 0; i < projectile2DforMainChars.Count; i++)
                    {
                        projectile2DforMainChars[i].Draw(OFFSET);
                    }
                }
            }
            else
            {
                //GameGlobals.score = GameGlobals.score + 5;
                if (textCycle >= 0)
                {
                    backGroundEndGame.Draw(OFFSET);
                    textCycle++;
                }
                if (textCycle >= 25)
                {
                    GameOver01.Draw(OFFSET);
                    textCycle++;
                }
                if (textCycle >= 50)
                {
                    GameOver02.Draw(OFFSET);
                    textCycle++;
                }
                if (textCycle >= 75)
                {
                    GameOver03.Draw(OFFSET);
                    textCycle++;
                }
                if (textCycle >= 90)
                {
                    textCycle = 0;
                }
                ResetBtn.Draw(OFFSET);
                ExitBtn.Draw(OFFSET);
                if (GameGlobals.score != 0)
                {
                    E0 = GameGlobals.score % 10;
                    GameGlobals.score = GameGlobals.score / 10;
                    E1 = GameGlobals.score % 10;
                    GameGlobals.score = GameGlobals.score / 10;
                    E2 = GameGlobals.score % 10;
                    GameGlobals.score = GameGlobals.score / 10;
                    E3 = GameGlobals.score % 10;
                    GameGlobals.score = GameGlobals.score / 10;
                }
                if (E0 == 5)
                {
                    scoreE00.Draw(OFFSET);
                }
                if (E0 == 0)
                {
                    scoreE00.Draw(OFFSET);
                }
                if (E1 == 0)
                {
                    scoreE10.Draw(OFFSET);
                }
                if (E1 == 1)
                {
                    scoreE11.Draw(OFFSET);
                }
                if (E1 == 2)
                {
                    scoreE12.Draw(OFFSET);
                }
                if (E1 == 3)
                {
                    scoreE13.Draw(OFFSET);
                }
                if (E1 == 4)
                {
                    scoreE14.Draw(OFFSET);
                }
                if (E1 == 5)
                {
                    scoreE15.Draw(OFFSET);
                }
                if (E1 == 6)
                {
                    scoreE16.Draw(OFFSET);
                }
                if (E1 == 7)
                {
                    scoreE17.Draw(OFFSET);
                }
                if (E1 == 8)
                {
                    scoreE18.Draw(OFFSET);
                }
                if (E1 == 9)
                {
                    scoreE19.Draw(OFFSET);
                }
                if (E2 == 0)
                {
                    scoreE20.Draw(OFFSET);
                }
                if (E2 == 1)
                {
                    scoreE21.Draw(OFFSET);
                }
                if (E2 == 2)
                {
                    scoreE22.Draw(OFFSET);
                }
                if (E2 == 3)
                {
                    scoreE23.Draw(OFFSET);
                }
                if (E2 == 4)
                {
                    scoreE24.Draw(OFFSET);
                }
                if (E2 == 5)
                {
                    scoreE25.Draw(OFFSET);
                }
                if (E2 == 6)
                {
                    scoreE26.Draw(OFFSET);
                }
                if (E2 == 7)
                {
                    scoreE27.Draw(OFFSET);
                }
                if (E2 == 8)
                {
                    scoreE28.Draw(OFFSET);
                }
                if (E2 == 9)
                {
                    scoreE29.Draw(OFFSET);
                }
                //ResetScript.Draw(OFFSET);
                //ExitScript.Draw(OFFSET);
                //if (GameGlobals.score % 10 == 0) score00.Draw(OFFSET); else score05.Draw(OFFSET);
            }
            Globals.spriteBatch.DrawString(tester, GameGlobals.score.ToString(), new Vector2(1000, 1000), Color.Red, 0, OFFSET, 2, new SpriteEffects(), 0);

            // countscore
            #region
            if (GameGlobals.score != 0 && MobDowns.Current < 42 && MobTops.Current < 42 && MobLefts.Current < 42 && MobRights.Current < 42)
            {
                if (GameGlobals.score % 5 == 0)
                {
                    score05.Draw(OFFSET);
                }
                if (GameGlobals.score % 10 == 0)
                {
                    score00.Draw(OFFSET);
                }
                if (GameGlobals.score >= 10)
                {
                    score01.Draw(OFFSET);
                }
                if (GameGlobals.score >= 20)
                {
                    score02.Draw(OFFSET);
                }
                if (GameGlobals.score >= 30)
                {
                    score03.Draw(OFFSET);
                }
                if (GameGlobals.score >= 40)
                {
                    score04.Draw(OFFSET);
                }
                if (GameGlobals.score >= 50)
                {
                    score052nd.Draw(OFFSET);
                }
                if (GameGlobals.score >= 60)
                {
                    score06.Draw(OFFSET);
                }
                if (GameGlobals.score >= 70)
                {
                    score07.Draw(OFFSET);
                }
                if (GameGlobals.score >= 80)
                {
                    score08.Draw(OFFSET);
                }
                if (GameGlobals.score >= 90)
                {
                    score09.Draw(OFFSET);
                }
                if (GameGlobals.score >= 100)
                {
                    score013rd.Draw(OFFSET);
                    if (GameGlobals.score < 110)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 110)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 120)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 130)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 140)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 150)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 160)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 170)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 180)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 190)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 200)
                {
                    score023rd.Draw(OFFSET);
                    if (GameGlobals.score < 210)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 210)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 220)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 230)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 240)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 250)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 260)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 270)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 280)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 290)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 300)
                {
                    score033rd.Draw(OFFSET);
                    if (GameGlobals.score < 310)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 310)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 320)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 330)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 340)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 350)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 360)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 370)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 380)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 390)
                    {
                        score09.Draw(OFFSET);
                    }
                }

                if (GameGlobals.score >= 400)
                {
                    score043rd.Draw(OFFSET);
                    if (GameGlobals.score < 410)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 410)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 420)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 430)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 440)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 450)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 460)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 470)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 480)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 490)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 500)
                {
                    score053rd.Draw(OFFSET);
                    if (GameGlobals.score < 510)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 510)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 520)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 530)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 540)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 550)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 560)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 570)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 580)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 590)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 600)
                {
                    score063rd.Draw(OFFSET);
                    if (GameGlobals.score < 610)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 610)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 620)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 630)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 640)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 650)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 660)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 670)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 680)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 690)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 700)
                {
                    score073rd.Draw(OFFSET);
                    if (GameGlobals.score < 710)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 710)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 720)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 730)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 740)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 750)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 760)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 770)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 780)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 790)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 800)
                {
                    score083rd.Draw(OFFSET);
                    if (GameGlobals.score < 810)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 810)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 820)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 830)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 840)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 850)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 860)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 870)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 880)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 890)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 900)
                {
                    score093rd.Draw(OFFSET);
                    if (GameGlobals.score < 910)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 910)
                    {
                        score01.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 920)
                    {
                        score02.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 930)
                    {
                        score03.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 940)
                    {
                        score04.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 950)
                    {
                        score052nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 960)
                    {
                        score06.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 970)
                    {
                        score07.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 980)
                    {
                        score08.Draw(OFFSET);
                    }
                    if (GameGlobals.score >= 990)
                    {
                        score09.Draw(OFFSET);
                    }
                }
                if (GameGlobals.score >= 1000)
                {
                    if (GameGlobals.score < 1010)
                    {
                        score002nd.Draw(OFFSET);
                    }
                    if (GameGlobals.score < 1100)
                    {
                        score003rd.Draw(OFFSET);
                    }
                    score014th.Draw(OFFSET);
                }
            }
            #endregion
        }
コード例 #3
0
 public virtual void Draw(Vector2 OFFSET)
 {
     HealthMin.Draw(OFFSET, new Vector2(0, 0));
     HealthMax.Draw(OFFSET, new Vector2(0, 0));
     Healthnoblood.Draw(OFFSET, new Vector2(0, 0));
 }