public override Boolean isAchieving(Football football) { if (football.speed.Y < 0) { return false; } //int yOfLoop = (int)(this.vecPosition.Y + (this.dimensions.Y / 2)); int yOfLoop = (int)this.vecPosition.Y; int midYFootball = (int)(football.position.Y + football.radius); int lowYFootballBound = (int)(midYFootball - (0.3 * football.radius)); int highYFootballBound = (int)(midYFootball + (0.3 * football.radius)); if (yOfLoop > lowYFootballBound && yOfLoop < midYFootball) { int lowXBoundLoop = (int)this.vecPosition.X; int highXBoundLoop = (int)this.vecPosition.X + (int)this.dimensions.X; int lowXBoundFootball = (int)football.position.X; int highXBoundFootball = (int)(football.position.X + (football.radius * 2)); if (lowXBoundFootball > lowXBoundLoop && highXBoundFootball < highXBoundLoop) { UpdateStatsOnAchieving(); return true; } } return false; }
public override void makeChange(Football football, GameTime gameTime) { //football.bonusObjectsInEffect.Add(this); football.MakeBallSmaller(); game.stats.DrawStringBallSmaller(); game.stats.AddCurrentBonusObject("small ball", this.texture2d); }
public override void makeChange(Football football, GameTime gameTime) { //football.bonusObjectsInEffect.Add(this); football.TimeBonusChange(gameTime); game.stats.DrawTimeFreeze(); game.stats.AddCurrentBonusObject("time bonus", this.texture2d); }
public override Boolean isAchieving(Football football) { float radius = this.dimensions.X / 2; BoundingSphere bonusball = new BoundingSphere(new Vector3(vecPosition.X + radius, vecPosition.Y + radius, 0), radius); BoundingSphere footballsphere = new BoundingSphere(new Vector3(football.position.X + football.radius, football.position.Y + football.radius, 0), football.radius); if (bonusball.Intersects(footballsphere)) { UpdateStatsOnAchieving(); return true; } return false; }
public Boolean isAchieving(Football football) { float radius = this.vecDimensions.X / 2; BoundingSphere starSphere = new BoundingSphere(new Vector3(vecPosition.X + radius, vecPosition.Y + radius, 0), radius); BoundingSphere footballsphere = new BoundingSphere(new Vector3(football.position.X + football.radius, football.position.Y + football.radius, 0), football.radius); if (starSphere.Intersects(footballsphere)) { return true; } return false; }
/// <summary> /// Constructor. /// </summary> public GameplayScreen() { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); this.height = 800;//this.GraphicsDevice.Viewport.Height; this.width = 480;//this.GraphicsDevice.Viewport.Width; this.gameStarted = false; stats = new Stats(this); football = new Football(this, new Vector2(240- Football.InitialFootballRadius, this.GameHeight() - (2 * Football.InitialFootballRadius)), new Vector2(0.0f, 0.0f), Football.InitialFootballRadius, stats); }
public override void makeChange(Football football, GameTime gameTime) { this.game.stats.addPoints(100); this.game.stats.DrawThroughTheLoopString("+100 Through the basket!!!"); }
// make the following change on achieving this. public override void makeChange(Football football, GameTime gameTime) { football.DoublePointsChange(gameTime); this.game.stats.DrawDoublePoints(); this.game.stats.AddCurrentBonusObject("double", this.texture2d); }
public virtual void makeChange(Football football, GameTime gameTime) { }
public virtual Boolean isAchieving(Football football) { return false; }
// make the following change on achieving this. public override void makeChange(Football football, GameTime gameTime) { football.WindEffect(); this.game.stats.DrawWindRight(); this.game.stats.AddCurrentBonusObject("wind", this.texture2d); }