Пример #1
0
 public override void BumpTransition()
 {
     CurrentState.ExitState();
     CurrentState = new BrickBlockState(Block);
     CurrentState.Enter(this);
     Block.Sounds.PlaySound(EventSoundEffects.EventSounds.BrickBump);
 }
Пример #2
0
 public BrickBlockEntity(Vector2 loc, EventSoundEffects sounds) : base(loc, sounds)
 {
     Sounds  = sounds;
     Factory = new BlockFactory();
     BState  = new BrickBlockState(this);
     Sprite  = Factory.BuildSprite(Factory.FindType(BState), loc);
     BState.Enter(null);
     SpritePosition  = loc;
     InitialPos      = loc;
     EntityCollision = new BlockCollision(this);
 }
Пример #3
0
        private void ChangeState(BlockType type)
        {
            switch (type)
            {
            case BlockType.Brick:
                State = new BrickBlockState(this);
                break;

            case BlockType.BrickCoin:
                State = new BrickCoinState(this);
                break;

            case BlockType.BrickStar:
                State = new BrickStarState(this);
                break;

            case BlockType.ItemCoin:
                State = new ItemBlockCoinState(this);
                break;

            case BlockType.ItemPowerUp:
                State = new ItemBlockPowerUpState(this);
                break;

            case BlockType.Hidden:
                State = new HiddenItemBlockState(this);
                break;

            case BlockType.ItemUsed:
                State = new ItemBlockUsedState(this);
                break;

            case BlockType.Ground:
                State = new GroundBlockState(this);
                break;

            case BlockType.Unbreakable:
                State = new UnbreakableBlockState(this);
                break;

            case BlockType.BlueBrick:
                State = new BlueBrickState(this);
                break;

            case BlockType.BlueGround:
                State = new BlueGroundState(this);
                break;
            }
        }
Пример #4
0
 public override void StandardTransition()
 {
     CurrentState.ExitState();
     CurrentState = new BrickBlockState(Block);
     CurrentState.Enter(this);
 }