Пример #1
0
        private void ExtremeGenerate()
        {
            int posy = mg.NewY();

            switch (MapGenerator.RandomInt(1, 15))
            {
            case 1: actors.Add(new SpeedBuff(1050, posy, 20, 20, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 2: actors.Add(new SlowBuff(1050, posy, 20, 20, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 3: actors.Add(new LifeBuff(1050, posy, 20, 20, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 4: actors.Add(new JumpBuff(1050, posy, 20, 20, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 5: actors.Add(new RiotFistBuff(1050, posy, 40, 40, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 6: actors.Add(new BeamBuff(1050, posy, 25, 25, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 7: actors.Add(new Mario(1050, posy, 40, 40, true));
                stac.Add(new StaticActorController(actors.Last()));
                break;

            case 8: actors.Add(new TrickyPlatform(1050, posy, 20, 100, true));
                stac.Add(new TrickyPlatformController(actors.Last(), (actors.Last() as TrickyPlatform)));
                break;
            }
        }
Пример #2
0
 private void Rendrakás()
 {
     foreach (Pawn akt in actors)
     {     //minden elemre
         if (akt is Player && (akt as Player).Falling == false)
         { //alap hejzetbe álltja a player szükséges értékeit nehogy lebegve maradjon
             Player play = akt as Player;
             play.Falling    = true;
             play.Standing   = false;
             play.Invincible = false;
             if (gm is PracticeGameMode && play.Health != play.MaxHealth)
             {//maximumra állítja a játékos életét ha a játékmód gyakorló
                 play.Damaged(-1);
             }
         }
         else if (akt is Platform && akt.X < -100)
         {                                                           //ha egy platform kimegy a képből visszarakja az elejére
             akt.X = 1050;
             akt.Y = mg.NewY();                                      //random magasság
             (akt as Platform).Speed = MapGenerator.RandomInt(1, 3); //random sebesség
         }
         else if (akt.X < -101)
         {//ha nem platform és kiér akkor meghal
             akt.Visible = false;
         }
         if (akt is Player && (!(akt as Player).MoveL || !(akt as Player).MoveR))
         {
             (akt as Player).CanMove = true;
         }
         foreach (Pawn inakt in actors)
         {//ütközés vizsgálat mindent mindennel :)
             if (CollisionAB.Collide(akt, inakt))
             {
                 akt.Utkozes(inakt);
             }
         }
     }
 }