コード例 #1
0
 public BlockStateMachine(BlockForm block)
 {
     QuestionBlock = new QuestionBlockState(this, block);
     UsedBlock     = new UsedBlockState(this, block);
     BrickBlock    = new BrickBlockState(this, block);
     FloorBlock    = new FloorBlockState(this, block);
     PyramidBlock  = new PyramidBlockState(this, block);
     HiddenBlock   = new HiddenBlockState(this, block);
     VMovingBlock  = new VMovingBlockState(this, block);
     HMovingBlock  = new HMovingBlockState(this, block);
 }
コード例 #2
0
 public MovingBlockEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt, float speed, bool hMovement, float start, float finish)
     : base(factory, ItemEnt)
 {
     Start           = start;
     Finish          = finish;
     Speed           = speed;
     isHMovement     = hMovement;
     Block           = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.USEDBLOCK);
     Block.Position  = position;
     Sprite.Position = position;
     Block.Velocity  = Vector2.Zero;
     BlockSM         = new BlockStateMachine(this);
     if (hMovement)
     {
         CurrentBlockState = new HMovingBlockState(BlockSM, this);
     }
     else
     {
         CurrentBlockState = new VMovingBlockState(BlockSM, this);
     }
 }