Exemplo n.º 1
0
        private void WindowLoaded(object sender, EventArgs e)
        {
            playfield.ClipToBounds = true;

            myFallingThings = new FallingThings(MaxShapes, targetFramerate, NumIntraFrames);

            UpdatePlayfieldSize();

            myFallingThings.SetGravity(dropGravity);
            myFallingThings.SetDropRate(dropRate);
            myFallingThings.SetSize(dropSize);
            myFallingThings.SetPolies(PolyType.Circle);

            popSound.Stream     = Properties.Resources.Pop_5;
            hitSound.Stream     = Properties.Resources.Hit_2;
            squeezeSound.Stream = Properties.Resources.Squeeze;

            popSound.Play();

            TimeBeginPeriod(TimerResolution);
            var myGameThread = new Thread(GameThread);

            myGameThread.SetApartmentState(ApartmentState.STA);
            myGameThread.Start();
        }
Exemplo n.º 2
0
        private void SetupConfiguration()
        {
            _dropSize = config.BubblesSize;
            _maxShapes = config.BubblesCount;
            _dropGravity = config.BubblesFallSpeed * 0.2;
            _dropRate = config.BubblesApperanceFrequency * 0.4;

            _myFallingThings = new FallingThings(_maxShapes, _targetFramerate, NumIntraFrames, _maxShapes);

            UpdatePlayfieldSize();

            _myFallingThings.SetGravity(_dropGravity);
            _myFallingThings.SetDropRate(_dropRate);
            _myFallingThings.SetSize(_dropSize);
            _myFallingThings.SetPolies(PolyType.Circle);

            _popSound.Stream = Properties.Resources.Pop_5;
            _hitSound.Stream = Properties.Resources.Hit_2;
            _squeezeSound.Stream = Properties.Resources.Squeeze;

            _popSound.Play();

            TimeBeginPeriod(TimerResolution);
        }