0% found this document useful (0 votes)
3 views

Message

Uploaded by

desafiantevini
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Message

Uploaded by

desafiantevini
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

private ParticlesBy_By _particlesBy_By;

public Sing()
{
InitializeComponent();

_particlesBy_By = new ParticlesBy_By();

Timer timer = new Timer


{
Interval = 3 // Roughly 60 FPS
};
timer.Tick += (sender, args) =>
{
_particlesBy_By.UpdateParticles();
Invalidate(); // Causes the form to be redrawn
};
timer.Start();

Anti_Cheat.Interval = 1000;
Anti_Cheat.Tick += Anti_Cheat_Tick;
Anti_Cheat.Start();

SetupCaretPositionUpdater(txtkey);
SetupCaretPositionUpdater(txtuser);
SetupCaretPositionUpdater(txtpassword);

}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);

e.Graphics.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.HighQuality;

for (int i = 0; i < _particlesBy_By.Particles.Count; i++)


{
var particle = _particlesBy_By.Particles[i];
DrawTriangleWithGlow(e.Graphics, particle.Position, particle.Size,
particle.Rotation);
}
}
private void DrawTriangleWithGlow(Graphics graphics, PointF position, float
size, float rotation)
{
float angle = (float)(Math.PI * 2 / 3); // 120 degrees for equilateral
triangle
PointF[] vertices = new PointF[3];

for (int i = 0; i < 3; i++)


{
vertices[i] = new PointF(
position.X + size * (float)Math.Cos(rotation + i * angle),
position.Y + size * (float)Math.Sin(rotation + i * angle)
);
}

graphics.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

// Draw glow effect


int maxGlowLayers = 10;
for (int j = 0; j < maxGlowLayers; j++)
{
int alpha = 25 - 2 * j; // Gradually decrease alpha for each layer
using (Brush glowBrush = new SolidBrush(Color.FromArgb(alpha, 255,
0, 0)))
{
float glowSize = size + j * 2; // Gradually increase the glow
size
graphics.FillEllipse(glowBrush, position.X - glowSize / 2,
position.Y - glowSize / 2, glowSize, glowSize);
}
}

using (Brush brush = new SolidBrush(Color.FromArgb(255, 0, 0)))


{
graphics.FillPolygon(brush, vertices);
}
}

You might also like