Пример #1
0
        public StarDuckHandler(Duck stunTarget, int stunTime = 10, bool fixH = false, bool fixV = false, bool showDaze = false)
        {
            _stunTarget = stunTarget;
            _stunTime   = stunTime;
            _fixH       = fixH;
            _fixV       = fixV;
            _showDaze   = showDaze;
            foreach (Thing t in Level.current.things)
            {
                if (t is StarDuckHandler && t != this && ((StarDuckHandler)t)._stunTarget == stunTarget && !((StarDuckHandler)t)._overrider)
                {
                    if (showDaze)
                    {
                        ((StarDuckHandler)t)._showDaze = true;
                    }
                    if (stunTime > ((StarDuckHandler)t)._stunTime)
                    {
                        ((StarDuckHandler)t)._stunTime = stunTime;
                    }
                    _overrider = true;
                }
            }

            mover = new SinWave(1f / 15f);
            ipos  = _stunTarget.position;
            _stunTarget.GoRagdoll();
        }
Пример #2
0
        public Confetti(float xpos, float ypos)
            : base(xpos, ypos)
        {
            int num = Rando.ChooseInt(0, 1, 2, 3);

            if (num == 0)
            {
                this._color = Color.Violet;
            }
            if (num == 1)
            {
                this._color = Color.SkyBlue;
            }
            if (num == 2)
            {
                this._color = Color.Wheat;
            }
            if (num == 4)
            {
                this._color = Color.GreenYellow;
            }
            this._sin   = new SinWave(0.01f + Rando.Float(0.03f), Rando.Float(7f));
            this._size  = 10f + Rando.Float(60f);
            this._speed = 0.8f + Rando.Float(1.4f);
            this.depth  = new Depth(0.95f);
        }
Пример #3
0
        static void Main(string[] args)
        {
            //SinWave signal = new SinWave(10, 440);
            //var wave = signal.GetWave(1,0,11025);



            SinWave A    = new SinWave(1, 440);
            SinWave B    = new SinWave(1, 880);
            var     sum  = A + B;
            var     wave = sum.GetWave(1, 0, 11025);



            Console.WriteLine("Hello World!");
        }
Пример #4
0
        public MusicNote(float xpos, float ypos, Vec2 dir)
            : base(xpos, ypos)
        {
            this._sprite       = new SpriteMap("notes", 8, 8);
            this._sprite.frame = Rando.Int(1);
            this._sprite.CenterOrigin();
            int num1 = Rando.ChooseInt(0, 1, 2, 3);

            if (num1 == 0)
            {
                this._color = Color.Violet;
            }
            if (num1 == 1)
            {
                this._color = Color.SkyBlue;
            }
            if (num1 == 2)
            {
                this._color = Color.Wheat;
            }
            if (num1 == 4)
            {
                this._color = Color.GreenYellow;
            }
            this._dir = dir;
            float num2 = 1f;

            if ((double)Rando.Float(1f) <= 0.5)
            {
                num2 = -1f;
            }
            this._sin   = new SinWave(0.03f + Rando.Float(0.1f), num2 * 6.283185f);
            this._size  = 3f + Rando.Float(6f);
            this._speed = 0.8f + Rando.Float(1.4f);
            this.depth  = new Depth(0.95f);
            this.scale  = new Vec2(0.1f, 0.1f);
        }
Пример #5
0
    void CreateSinWave(float amp, float freq, float angle)
    {
        var wave = new SinWave(freq, amp, angle);

        waves.Add(wave);
    }