Ejemplo n.º 1
0
 public void LoadLevel(bool player)
 {
     Modifier.modifyGame();
     HitObjects.Clear();
     Objects.Clear();
     HP.Clear();
     Score = 0;
     Combo = 0;
     Lives = Modifier.Lives();
     Block.RegisterBlock("Platform", typeof(Platform));
     Block.RegisterBlock("Player", typeof(Player));
     Objects.Add(Block.CreateBlock("Platform", 100, 10, 0, 525, DefaultColor));
     Objects.Add(Block.CreateBlock("Platform", 100, 10, 700, 525, DefaultColor));
     Objects.Add(Block.CreateBlock("Platform", 100, 10, 150, 450, DefaultColor));
     Objects.Add(Block.CreateBlock("Platform", 100, 10, 550, 450, DefaultColor));
     Objects.Add(Block.CreateBlock("Platform", 200, 10, 300, 375, DefaultColor));
     HP.Add(new HP(Color.OrangeRed, 25, 490, 50, 25, false, "HP"));
     HP.Add(new HP(Color.OrangeRed, 725, 490, 50, 25, false, "HP"));
     HP.Add(new HP(Color.OrangeRed, 175, 415, 50, 25, false, "HP"));
     HP.Add(new HP(Color.OrangeRed, 575, 415, 50, 25, false, "HP"));
     HP.Add(new HP(Color.IndianRed, 375, 340, 50, 25, false, "MAX"));
     if (player)
     {
         Objects.Add(Block.CreateBlock("Player", 75, 50, 200, 550, Color.OrangeRed));
     }
 }
Ejemplo n.º 2
0
        public void Draw()
        {
            SplashKit.ClearScreen();
            SplashKit.DrawBitmap("Background", 0, 0);
            foreach (GameObject o in Objects)
            {
                o.Draw();
            }
            if (HP.Count > 0)
            {
                for (int i = 0; i < HP.Count; i++)
                {
                    if (HP[i].Hit)
                    {
                        HP.Remove(HP[i]);
                    }
                    else
                    {
                        HP[i].Draw();
                    }
                }
            }
            if (HitObjects.Count > 0)
            {
                for (int i = 0; i < HitObjects.Count; i++)
                {
                    if (HitObjects[i].Y >= SplashKit.ScreenHeight() || HitObjects[i].Hit)
                    {
                        HitObjects.Remove(HitObjects[i]);
                    }
                    else
                    {
                        HitObjects[i].Draw();
                    }
                }
            }

            Player.Draw();
            Modifier.drawScore();
            ProgressBar();
        }