예제 #1
0
 public UsedBlockEntity(ObstacleFactory factory, Vector2 position, Entity ItemEnt)
     : base(factory, ItemEnt)
 {
     Block             = (AbstractObstacle)SpriteFactory.getSprite((int)obstacleTypes.USEDBLOCK);
     Block.Position    = position;
     CurrentBlockState = new UsedBlockState(BlockSM, this);
 }
예제 #2
0
 public LevelFlagEntity(Scene scene, ObstacleFactory factory, Vector2 position)
     : base(scene, factory, position)
 {
     Flag            = (AbstractObstacle)Factory.getFlag((int)flagTypes.FLAG);
     Flag.Position   = position;
     Sprite.Position = position;
 }
예제 #3
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);
 }
예제 #4
0
 public LevelCheckpointEntity(Scene scene, ObstacleFactory factory, Vector2 position, int ID)
     : base(scene, factory, position)
 {
     Flag            = (AbstractObstacle)Factory.getFlag((int)flagTypes.CHECKPOINT);
     Flag.Position   = position;
     Sprite.Position = position;
     this.ID         = ID;
 }
예제 #5
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);
 }
예제 #6
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);
 }
예제 #7
0
 protected BlockForm(ObstacleFactory factory, Entity ItemEnt) : base()
 {
     item = (ItemEntity)ItemEnt;
     if (item != null)
     {
         item.ChangeItemState(item.ItemSM.Inactive);
     }
     SpriteFactory = factory;
 }
예제 #8
0
 public FlagEntity(Scene scene, ObstacleFactory factory, Vector2 position)
     : base()
 {
     this.scene = scene;
     Factory    = factory;
     isHit      = false;
     HUD.PointTracker.Subscribe(this);
     HUD.MarioLifeTracker.Subscribe(this);
 }
예제 #9
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);
        }
예제 #10
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);
     }
 }