Beispiel #1
0
    public async void Splat(AdditionalParameters ap)
    {
        if (_splatcount > 20)
        {
            return;
        }

        //r=1050
        //1050=baseradius * intervals
        int intervals = 9999;
        int radiusx = 1680 * r.Next(intervals + 1) / intervals + 1, radiusy = 1050 * r.Next(intervals + 1) / intervals + 1;

        _splatcount++;
        OverlayImage oi = new OverlayImage("splat.png", 255);

//        oi.TopMost = true;
        {
            //oi.ShowInTaskbar = false;

            int x = 1680 / 2 + r.Next(radiusx / 2) - r.Next(radiusx / 2) - 168;
            int y = 1050 / 2 + r.Next(radiusy / 2) - r.Next(radiusy / 2) - 149;

            oi.Location = new Point(x, y);
            await Task.Delay(1000 + r.Next(3000));

            int speed = 10 + r.Next(40);
            for (int i = 0; i < r.Next(50) + 150; i++)
            {
                oi.Location = new Point(oi.Location.X, oi.Location.Y + 1);
                await Task.Delay(speed);
            }
        }
        oi.Close();
        _splatcount--;
    }