Пример #1
0
 public void Execute()
 {
     if (myGame.fbDelay == zero && myGame.marioState.curStat == MarioStateClass.marioStatus.fire && !myGame.marioState.lvlComp)
     {
         Fireball newBall = new Fireball(myGame.marioState, myGame.fireballSprite);
         myGame.fireBalls.Add(newBall);
         myGame.fbDelay = 40;
         myGame.soundEffect.Fireball();
     }
 }
 public void HandleCollision(Fireball fBalls)
 {
     if (vColFrom.Equals(sides.top))
     {
         fBalls.Bounce();
     }
     else
     {
         fBalls.Delete();
     }
 }
        private void DetectProjEnemyCol(Fireball fBalls)
        {
            foreach (IEnemy enemy in enemyList)
            {
                Rectangle enemyRec = enemy.DestinationRectangle();

                if (enemy.visible && projRec.Intersects(enemyRec))
                {
                    projEnemyColHandler = new ProjectileEnemyCollisionHandler(myGame);
                    projEnemyColHandler.HandleCollision(enemy);
                }
            }
        }
        private void DetectProjBlockCol(Fireball fBalls)
        {
            foreach (IBlock block in blockList)
            {
                Rectangle blockRec = block.DestinationRectangle();

                if (block.visible && projRec.Intersects(blockRec))
                {
                    projBlock.CollidesFrom(projRec, blockRec);
                    projBlockColHandler          = new ProjectileBlockCollisionHandler(myGame);
                    projBlockColHandler.vColFrom = projBlock.vColFrom;
                    projBlockColHandler.HandleCollision(fBalls);
                }
            }
        }
Пример #5
0
        private void OnPaint(object sender, PaintEventArgs e)
        {
            g = e.Graphics;

            MapController.SeedMap(g, RB1, RB2, RB3, RB4, BB1, BB2, BB3, BB4, P1, P2, P3, P4, P5, P6);
            MapController.DrawMap(g);
            player.Animation(g);

            if (imp1.HP == 1)
            {
                imp1.Animation(g);
            }

            if (imp2.HP == 1)
            {
                imp2.Animation(g);
            }

            if (imp3.HP == 1)
            {
                imp3.Animation(g);
            }

            if (imp4.HP == 1)
            {
                imp4.Animation(g);
            }

            if (imp5.HP == 1)
            {
                imp5.Animation(g);
            }

            if (imp6.HP == 1)
            {
                imp6.Animation(g);
            }

            if (imp7.HP == 1)
            {
                imp7.Animation(g);
            }

            if (imp8.HP == 1)
            {
                imp8.Animation(g);
            }

            if (Skelet1.HP == 1)
            {
                Skelet1.Animation(g);
            }

            if (Skelet2.HP == 1)
            {
                Skelet2.Animation(g);
            }

            if (Skelet3.HP == 1)
            {
                Skelet3.Animation(g);
            }

            if (Skelet4.HP == 1)
            {
                Skelet4.Animation(g);
            }

            if (Skelet5.HP == 1)
            {
                Skelet5.Animation(g);
            }

            if (Skelet6.HP == 1)
            {
                Skelet6.Animation(g);
            }

            if (Skelet7.HP == 1)
            {
                Skelet7.Animation(g);
            }

            if (Skelet8.HP == 1)
            {
                Skelet8.Animation(g);
            }

            if (Slime1.HP == 1)
            {
                Slime1.Animation(g);
            }

            if (Slime2.HP == 1)
            {
                Slime2.Animation(g);
            }

            if (Slime3.HP == 1)
            {
                Slime3.Animation(g);
            }

            if (Slime4.HP == 1)
            {
                Slime4.Animation(g);
            }

            if (Slime5.HP == 1)
            {
                Slime5.Animation(g);
            }

            if (fire)
            {
                if (Fireball.mkfireball(g, player, ref FireBall, FBInterect(FireBall), facing))
                {
                    fire = false;
                }
            }

            MapController.DisplayHP(g, player);
        }