private void TransitFunc(BCBlockGameState gstate, TransitoryBlockObject sender)
        {
            ReleaseCount--;
            if(ReleaseCount==0)
            {
                CurrentMode = PowerupBlockMode.BlockMode_Empty;
                BlockImageKey = emptyimagekey;
            }
            else
            {
                CurrentMode = PowerupBlockMode.BlockMode_Filled;
            }

            GameCharacterPowerup gcp = (GameCharacterPowerup)Activator.CreateInstance(_PowerupType, this);
            String emergesound = gcp.GetEmergeSound();
            BCBlockGameState.Soundman.PlaySound(emergesound);
            //gstate.GameObjects.AddLast(gcp);
            gstate.NextFrameCalls.Enqueue
                (new BCBlockGameState.NextFrameStartup((a, b) => { b.GameObjects.AddLast(gcp); return false; }, null));
            gstate.Forcerefresh = true;
        }
        public override bool PerformBlockHit(BCBlockGameState parentstate, cBall ballhit)
        {
            if (CurrentMode == PowerupBlockMode.BlockMode_Filled)
            {
                if (isEmergePower())
                {
                    try
                    {
                        TransitoryBlockObject tbo = new TransitoryBlockObject(this);
                        parentstate.Defer(()=>parentstate.GameObjects.AddLast(tbo));
                        tbo.TransitionComplete = TransitFunc;
                        CurrentMode = PowerupBlockMode.BlockMode_Transitory;

                        BumpObjects(parentstate);
                    }
                    catch (Exception err)
                    {
                        Debug.Print(err.ToString());

                    }
                }
                else
                {
                    //call transitfunc directly.
                    TransitFunc(parentstate, null);

                }
            }
            base.PerformBlockHit(parentstate, ballhit);
            BCBlockGameState.Soundman.PlaySound("bump");
            return false;
        }