コード例 #1
0
 public void RecordBlockHasBeenSmashed(SmashBlock smashedBlock)
 {
     if (!_smashedBlockWorldPositions.Contains(smashedBlock.WorldPosition))
     {
         _smashedBlockWorldPositions.Add(smashedBlock.WorldPosition);
     }
 }
コード例 #2
0
 public void CreateItemsForSmashBlock(SmashBlock smashedBlock)
 {
     for (int i = 0; i < smashedBlock.Contents.Count; i++)
     {
         CreateItemsForSingleTexture(
             smashedBlock.Contents[i],
             smashedBlock.WorldPosition + (new Vector2(Definitions.Grid_Cell_Pixel_Size) / 2.0f),
             smashedBlock.CameraPosition);
     }
 }
コード例 #3
0
        public void UpdateFromSmashBlockContents(SmashBlock smashedBlock)
        {
            for (int i = 0; i < smashedBlock.Contents.Count; i++)
            {
                switch (smashedBlock.Contents[i].AffectsItem)
                {
                case SmashBlockItemData.AffectedItem.Score: AddScoreForUnits(smashedBlock.Contents[i].Value, smashedBlock.Contents[i].Count); break;

                case SmashBlockItemData.AffectedItem.GoldenTicket: HandleGoldenTicketCollection(smashedBlock); break;
                }
            }
        }
コード例 #4
0
 private void HandleSmashBlockCollision(SmashBlock collidingSmashBlock)
 {
     if ((_motionEngine.VerticalMovementCanSmash) || (_isSmashingSmashBlocks))
     {
         collidingSmashBlock.HandleSmash();
         _motionEngine.PreventNextJump();
         _isSmashingSmashBlocks = true;
     }
     else
     {
         HandleSolidBlockCollision(collidingSmashBlock);
         _motionEngine.PlayerHasJustLandedOnSmashBlock = true;
     }
 }
コード例 #5
0
        protected override void HandleSmashBlockSmash(SmashBlock smashedBlock)
        {
            if (smashedBlock.Contents.Count > 0)
            {
                _powerUpButton.IconTexture = smashedBlock.Contents[0].TextureName;
                _powerUpCoordinator.SetAvailablePowerUpFromTexture(smashedBlock.Contents[0].TextureName);

                if (Data.Profile.Settings.ShowPowerUpHelpers)
                {
                    _powerUpHelper.SetHelpText(smashedBlock.Contents[0].TextureName);
                    _powerUpHelper.Activate();
                }

                _inputProcessor.ActivateButton(PowerUpButton.In_Game_Button_Name);
            }
            base.HandleSmashBlockSmash(smashedBlock);
        }
コード例 #6
0
 protected override void HandleSmashBlockSmash(SmashBlock smashedBlock)
 {
     LevelData.UpdateFromSmashBlockContents(smashedBlock);
     base.HandleSmashBlockSmash(smashedBlock);
 }
コード例 #7
0
        private SmashBlock CreateSmashBlock(string textureName)
        {
            SmashBlock newBlock = new SmashBlock();
            newBlock.TextureReference = textureName;

            return newBlock;
        }
コード例 #8
0
 public void LaunchCrateSmash(SmashBlock targetCrate)
 {
     CreateEffectAtObjectPosition("crate-smash", "particle-wood", targetCrate).Activate();
 }
コード例 #9
0
 protected virtual void HandleSmashBlockSmash(SmashBlock smashedBlock)
 {
     _opaqueParticleEffectManager.LaunchCrateSmash(smashedBlock);
     _smashBlockItemFactory.CreateItemsForSmashBlock(smashedBlock);
 }
コード例 #10
0
 private void ActivateSmashBlockContentSelector(SmashBlock target)
 {
     ((SmashBlockItemsSelector)_modalBoxes["smash-block-contents-selector"]).Target = target;
     ActivateModalBox("smash-block-contents-selector");
 }
コード例 #11
0
 private void ActivateSmashBlockContentSelector(SmashBlock target)
 {
     ((SmashBlockItemsSelector)_modalBoxes["smash-block-contents-selector"]).Target = target;
     ActivateModalBox("smash-block-contents-selector");
 }