public override bool CollisionResponse(AbstractGameObject gameObject, Side side, GameTime gameTime) { if (side == Side.Bottom) { Gravity = false; } bool retVal1 = PowerupStateBowser.CollisionResponse(gameObject, side, gameTime); bool retVal2 = ActionStateBowser.CollisionResponse(gameObject, side, gameTime); return(retVal1 || retVal2); }
public override bool Update(GameTime gameTime, float percent) { if (PowerupStateBowser is BowserDead) { BowserFireballPool.Update(gameTime); return(PowerupStateBowser.Update(gameTime, percent)); } CurrentCannonCoolDown += gameTime.ElapsedGameTime.Milliseconds; if (CurrentCannonCoolDown >= MaxTimeSummonCannon) { RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(rand); MaxTimeSummonCannon = ((rand[0] % 4) + 12) * 1000; CurrentCannonCoolDown = 0; EventManager.Instance.TriggerCannonEvent(this); } if (BoundingBox != null && BoundingBox.Dimensions.Bottom >= MarioCloneGame.LevelAreas[LevelArea].Bottom) { PowerupStateBowser.BecomeDead(); PowerupStateBowser.BecomeDead(); } if (Gravity) { Velocity = new Vector2(Velocity.X, Velocity.Y + GravityAcceleration * percent); } Gravity = true; bool retVal2 = ActionStateBowser.Update(gameTime, percent); bool retVal = PowerupStateBowser.Update(gameTime, percent); BowserFireballPool.Update(gameTime); Position = new Vector2(Position.X + Velocity.X, Position.Y + Velocity.Y * percent); Removed = retVal || retVal2; return(Removed); }