Ejemplo n.º 1
0
 public QuestionBlockEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt)
     : base(factory, ItemEnt)
 {
     Block             = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.QUESTIONBLOCK);
     Block.Position    = position;
     BlockSM           = new BlockStateMachine(this);
     CurrentBlockState = new QuestionBlockState(BlockSM, this);
 }
Ejemplo n.º 2
0
 public PyramidEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt)
     : base(factory, ItemEnt)
 {
     Block             = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.PYRAMID);
     Block.Position    = position;
     BlockSM           = new BlockStateMachine(this);
     CurrentBlockState = new PyramidBlockState(BlockSM, this);
 }
Ejemplo n.º 3
0
 public FloorBlockEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt, int floorType)
     : base(factory, ItemEnt)
 {
     Block             = (AbstractObstacle)SpriteFactory.getFloor(floorType);
     Block.Position    = position;
     BlockSM           = new BlockStateMachine(this);
     CurrentBlockState = new FloorBlockState(BlockSM, this);
 }
Ejemplo n.º 4
0
 public VMovingBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
     VStart          = block.Start;
     VFinish         = block.Finish;
     VSpeed          = block.Speed;
     block.Velocity  = new Vector2(0f, VSpeed);
     block.Direction = Direction.RIGHT; // RIGHT = DOWN
 }
Ejemplo n.º 5
0
 public HMovingBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
     HStart          = block.Start;
     HFinish         = block.Finish;
     Speed           = block.Speed;
     block.Velocity  = new Vector2(Speed, 0f);
     block.Direction = Direction.RIGHT;
 }
Ejemplo n.º 6
0
        public BrickEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt)
            : base(factory, ItemEnt)
        {
            Block          = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.BRICKBLOCK);
            Block.Position = position;
            Block.Position = Vector2.Clamp(this.Position, new Vector2(0f, Position.Y - 2f), new Vector2(1000000f, Position.Y));
            B = new AbstractObstacle[4];
            for (int i = 0; i < 4; i++)
            {
                B[i]          = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.BRICKSHARD);
                B[i].Position = Block.Position;
                B[i].Velocity = Vector2.Zero;
            }
            Sprite.Position = position;
            Block.Velocity  = Vector2.Zero;
            float originalPos = Block.Position.Y;

            BlockSM           = new BlockStateMachine(this);
            CurrentBlockState = new BrickBlockState(BlockSM, this);
        }
Ejemplo n.º 7
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);
     }
 }
Ejemplo n.º 8
0
 public PyramidBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }
 protected AbstractBlockState(BlockStateMachine sm, BlockForm blockForm)
 {
     stateMachine = sm;
     block        = blockForm;
 }
Ejemplo n.º 10
0
 public BrickBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }
Ejemplo n.º 11
0
 public UsedBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }
Ejemplo n.º 12
0
 public QuestionBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }
Ejemplo n.º 13
0
 public HiddenBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }
Ejemplo n.º 14
0
 public FloorBlockState(BlockStateMachine sm, BlockForm block)
     : base(sm, block)
 {
 }