public override void Update(GameTime gameTime) { elapsed += gameTime.ElapsedGameTime.TotalMilliseconds; if (elapsed < Config.bombBonusDuration) { float v = 255 - (float)(255 * elapsed / Config.bombBonusDuration); el.color = new Color(255, v, v); } else if (!exploded) { exploded = true; el.color = Color.Red; if (onExplosion != null) { onExplosion(this); } } if (exploded) { explosionTexture.Update(gameTime); } if (explosionTexture.ended) { ended = true; } base.Update(gameTime); }
public override void Update(GameTime gameTime) { float elapsedGameTime = (float)gameTime.ElapsedGameTime.TotalMilliseconds; if (!ended) { elapsed += elapsedGameTime; Vector2 prevPos = position; position = start + (end - start) * elapsed / duration; texture.Update(gameTime); if (onUpdate != null) { onUpdate(this, new LineBonusEventAgrs(prevPos, position)); } if (duration < elapsed) { ended = true; position = end; if (onEnd != null) { onEnd(this, new LineBonusEventAgrs(prevPos, position)); } } } base.Update(gameTime); }
public override void Update(GameTime gameTime) { texture.Update(gameTime); //base.Update(gameTime); }