private void DrawStar(Rectangle logoDest, SpriteBatch sb, PointClickerDaemon.PointClickerStar star) { Vector2 position = new Vector2((float)((double)star.Pos.X * (double)logoDest.Width * 0.5) + (float)logoDest.X, (float)((double)star.Pos.Y * (double)logoDest.Height * 0.5) + (float)logoDest.Y); position.X += (float)logoDest.Width * 0.25f; position.Y += (float)logoDest.Height * 0.25f; float num1 = (double)star.life >= 0.899999976158142 ? (float)(1.0 - ((double)star.life - 0.899999976158142) / 0.100000001490116) : (float)(((double)star.life - 0.100000001490116) / 0.899999976158142); float num2 = Vector2.Distance(star.Pos, new Vector2(0.5f)); float num3 = 0.9f; if ((double)num2 > (double)num3) { num1 = (float)(1.0 - ((double)num2 - (double)num3) / 1.0) * num1; } sb.Draw(this.logoStar, position, new Rectangle?(), star.color * num1, star.rot * (star.life * 0.5f), new Vector2((float)(this.logoStar.Width / 2), (float)(this.logoStar.Height / 2)), star.scale * num1, SpriteEffects.None, 0.4f); }
private void DrawLogo(Rectangle dest, SpriteBatch sb) { float totalSeconds = (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds; for (int index = 0; index < this.Stars.Count; ++index) { PointClickerDaemon.PointClickerStar star = this.Stars[index]; star.life -= totalSeconds * 2f * star.timescale; if ((double)this.Stars[index].life <= 0.0) { this.Stars.RemoveAt(index); --index; this.AddRandomLogoStar(false); } else { this.Stars[index] = star; } } RenderTarget2D currentRenderTarget = Utils.GetCurrentRenderTarget(); sb.GraphicsDevice.SetRenderTarget(this.logoRenderBase); sb.GraphicsDevice.Clear(Color.Transparent); this.logoBatch.Begin(); float num1 = (float)(Math.Sin((double)this.os.timer / 2.20000004768372) + 1.0) / 2f; this.logoBatch.Draw(this.background1, Vector2.Zero, Utils.AddativeWhite * num1); this.logoBatch.Draw(this.background2, Vector2.Zero, Utils.AddativeWhite * (1f - num1)); Rectangle dest1 = new Rectangle(0, 0, this.logoBase.Width, this.logoBase.Height); this.logoBatch.Draw(this.logoBase, Vector2.Zero, Color.White); FlickeringTextEffect.DrawFlickeringSprite(this.logoBatch, dest1, this.logoBase, 4f, 0.25f, (object)this.os, Color.White); float num2 = (float)(0.439999997615814 + (Math.Sin((double)this.os.timer * 0.823000013828278) + 1.0) / 2.0); this.logoBatch.Draw(this.logoOverlay1, Vector2.Zero, Utils.AddativeWhite * num2); this.logoBatch.Draw(this.logoOverlay2, Vector2.Zero, Utils.AddativeWhite * (1f - num2)); this.logoBatch.End(); sb.GraphicsDevice.SetRenderTarget(currentRenderTarget); for (int index = 0; index < this.Stars.Count; ++index) { this.DrawStar(dest, sb, this.Stars[index]); } FlickeringTextEffect.DrawFlickeringSpriteAltWeightings(sb, dest, (Texture2D)this.logoRenderBase, 4f, 0.01f, (object)this.os, Utils.AddativeWhite); }
private void AddRandomLogoStar(bool randomStartLife = false) { PointClickerDaemon.PointClickerStar pointClickerStar = new PointClickerDaemon.PointClickerStar() { Pos = new Vector2(Utils.randm(1f), Utils.randm(1f)), life = randomStartLife ? Utils.randm(1f) : 1f, rot = Utils.randm(6.48f), scale = 0.2f + Utils.rand(1.3f), timescale = 0.3f + Utils.randm(1.35f) }; pointClickerStar.color = Utils.AddativeWhite; float num = Utils.randm(1f); int maxValue = 80; if ((double)num < 0.300000011920929) { pointClickerStar.color.R = (byte)((int)byte.MaxValue - Utils.random.Next(maxValue)); } else if ((double)num < 0.600000023841858) { pointClickerStar.color.G = (byte)((int)byte.MaxValue - Utils.random.Next(maxValue)); } else if ((double)num < 0.899999976158142) { pointClickerStar.color.B = (byte)((int)byte.MaxValue - Utils.random.Next(maxValue)); } this.Stars.Add(pointClickerStar); }