コード例 #1
0
 public BowserDead(BowserObject context) : base(context)
 {
     Context.IsDead      = true;
     Context.PointValue  = 0;
     Context.BoundingBox = null;
     Context.Gravity     = false;
     Context.Sprite      = DeadEnemySpriteFactory.Create(EnemyType.Bowser);
 }
コード例 #2
0
 public BowserAlive(BowserObject context) : base(context)
 {
     if (Context.Orientation == Facing.Right)
     {
         Context.Velocity = new Vector2(1f, Context.Velocity.Y);
     }
     else if (Context.Orientation == Facing.Left)
     {
         Context.Velocity = new Vector2(-1f, Context.Velocity.Y);
     }
     Context.Sprite = MovingEnemySpriteFactory.Create(EnemyType.BowserIdle);
 }
コード例 #3
0
 public BowserWalk(BowserObject context) : base(context)
 {
     Action = BowserAction.Walk;
 }
コード例 #4
0
 protected BowserActionState(BowserObject context)
 {
     random  = new Byte[1];
     Context = context;
 }
コード例 #5
0
        public void TriggerPlayerKilledBowserEvent(BowserObject bowser, Mario player)
        {
            PlayerKilledBowserEventArgs args = new PlayerKilledBowserEventArgs(bowser, player);

            OnRaisePlayerKilledBowserEvent(args);
        }
コード例 #6
0
        public void TriggerCannonEvent(BowserObject boss)
        {
            CannonEventArgs args = new CannonEventArgs(boss);

            OnRaiseCannonEvent(args);
        }
コード例 #7
0
ファイル: BowserIdle.cs プロジェクト: Maplespyder/GameProject
 public BowserIdle(BowserObject context) : base(context)
 {
     Action           = BowserAction.Idle;
     Context.Velocity = Vector2.Zero;
 }
コード例 #8
0
        public virtual bool CollisionResponse(AbstractGameObject gameObject, Side side, GameTime gameTime)
        {
            if (gameObject is AbstractEnemy && !((AbstractEnemy)gameObject).IsDead)
            {
                if (side == Side.Bottom)
                {
                    if (gameObject is PiranhaObject)
                    {
                        TakeDamage(gameObject);
                    }
                    else if (gameObject is BowserObject)
                    {
                        if (Context.Velocity.X > 0)
                        {
                            Context.Velocity = new Vector2(Context.Velocity.X + 2, -7);
                        }
                        else if (Context.Velocity.X < 0)
                        {
                            Context.Velocity = new Vector2(Context.Velocity.X - 2, -7);
                        }
                        else
                        {
                            Context.Velocity = new Vector2(-5, -7);
                        }

                        float whereOnHitBox = Math.Abs(Context.Position.X - gameObject.Position.X);
                        if (whereOnHitBox > 250 && gameObject.Orientation is Facing.Left || whereOnHitBox < 600 && gameObject.Orientation is Facing.Right)
                        {
                            TakeDamage(gameObject);
                        }
                    }
                    else
                    {
                        Context.Velocity = new Vector2(Context.Velocity.X, -7);
                    }
                }
                else
                {
                    if (gameObject is BowserObject)
                    {
                        BowserObject boss = (BowserObject)gameObject;
                        if (!(boss.PowerupStateBowser is BowserInvincibility))
                        {
                            TakeDamage(gameObject);
                        }
                    }
                    else
                    {
                        TakeDamage(gameObject);
                    }
                }
                return(true);
            }
            else if (gameObject is AbstractBlock)
            {
                if (side == Side.Bottom && gameObject.Velocity.Y < 0)
                {
                    if (!ReferenceEquals(((AbstractBlock)gameObject).Bumper, Context))
                    {
                        TakeDamage(((AbstractBlock)gameObject).Bumper);
                    }
                }
            }
            else if (gameObject is Mario)
            {
                Mario temp = (Mario)gameObject;
                if (side == Side.Top)
                {
                    if (temp.ActionState is MarioFall2 && !Context.IsGroundDash)
                    {
                        TakeDamage(gameObject);
                    }
                }
                else if (side == Side.Bottom && !((temp.PowerupState is MarioInvincibility2) ||
                                                  temp.PowerupState is MarioDead2))
                {
                    if (!(Context.ActionState is MarioJump2))
                    {
                        Context.Velocity = new Vector2(Context.Velocity.X, -7);
                    }
                }
            }
            else if ((gameObject is FireBall && !ReferenceEquals(((FireBall)gameObject).Owner, Context)) && !Context.IsGroundDash)
            {
                TakeDamage(((FireBall)gameObject).Owner);
            }
            else if (gameObject is BigFireBall && !Context.IsGroundDash)
            {
                TakeDamage(((BigFireBall)gameObject).Owner);
            }
            else if (gameObject is CannonFireBall && !Context.IsGroundDash)
            {
                TakeDamage(((CannonFireBall)gameObject).Owner);
            }
            else if (gameObject is RedMushroomObject)
            {
                BecomeSuper();
                return(true);
            }
            else if (gameObject is FireFlowerObject)
            {
                BecomeFire();
                return(true);
            }

            return(false);
        }
コード例 #9
0
 protected BowserPowerupState(BowserObject context)
 {
     Context = context;
 }
コード例 #10
0
 public BowserFireBreathing(BowserObject context) : base(context)
 {
     Action           = BowserAction.BreatheFire;
     Context.Velocity = Vector2.Zero;
 }
コード例 #11
0
 public BowserInvincibility(BowserObject context) : base(context)
 {
     Powerup            = BowserPowerup.Invincible;
     Context.SpriteTint = new Color(Color.White, 100);
 }