public void RecordBlockHasBeenSmashed(SmashBlock smashedBlock) { if (!_smashedBlockWorldPositions.Contains(smashedBlock.WorldPosition)) { _smashedBlockWorldPositions.Add(smashedBlock.WorldPosition); } }
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); } }
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; } } }
private void HandleSmashBlockCollision(SmashBlock collidingSmashBlock) { if ((_motionEngine.VerticalMovementCanSmash) || (_isSmashingSmashBlocks)) { collidingSmashBlock.HandleSmash(); _motionEngine.PreventNextJump(); _isSmashingSmashBlocks = true; } else { HandleSolidBlockCollision(collidingSmashBlock); _motionEngine.PlayerHasJustLandedOnSmashBlock = true; } }
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); }
protected override void HandleSmashBlockSmash(SmashBlock smashedBlock) { LevelData.UpdateFromSmashBlockContents(smashedBlock); base.HandleSmashBlockSmash(smashedBlock); }
private SmashBlock CreateSmashBlock(string textureName) { SmashBlock newBlock = new SmashBlock(); newBlock.TextureReference = textureName; return newBlock; }
public void LaunchCrateSmash(SmashBlock targetCrate) { CreateEffectAtObjectPosition("crate-smash", "particle-wood", targetCrate).Activate(); }
protected virtual void HandleSmashBlockSmash(SmashBlock smashedBlock) { _opaqueParticleEffectManager.LaunchCrateSmash(smashedBlock); _smashBlockItemFactory.CreateItemsForSmashBlock(smashedBlock); }
private void ActivateSmashBlockContentSelector(SmashBlock target) { ((SmashBlockItemsSelector)_modalBoxes["smash-block-contents-selector"]).Target = target; ActivateModalBox("smash-block-contents-selector"); }