Пример #1
0
        //CollisionGrid CollisionGrid;
        public QuestionBlockModel(BlockSpriteFactory blockSpriteFactory, Vector2 coordinates, Vector2 velocity, ItemModelFactory itemModelFactory, string itemType, int numOfItems)
            : base(blockSpriteFactory)
        {
            //Initialize state first
            CurrentState = new QuestionBlockStandardState(this);
            CurrentState.Enter(null);

            //Define the characteristics of a brick block here
            Position     = coordinates;
            CurrentFrame = 0;
            //If additional frames of QuestionBlocks are added, update Columns
            Columns     = 3;
            Rows        = 1;
            LayerDepth  = 1;
            Scale       = new Vector2(10, 10);
            Width       = Texture.Width / Columns;
            Height      = Texture.Height / Rows;
            TotalFrames = 3;
            Velocity    = velocity;

            //Items
            ItemModelFactory = itemModelFactory;
            NumOfItems       = numOfItems;
            ItemType         = itemType;
            ItemModel        = itemModelFactory.GetItemModel(ItemType, coordinates, velocity);
            //CollisionGrid = collisionGrid;
            ItemModel.IsVisible = false;
        }
Пример #2
0
        //CollisionGrid CollisionGrid;
        public HiddenBlockModel(BlockSpriteFactory blockSpriteFactory, Vector2 coordinates, Vector2 velocity, ItemModelFactory itemModelFactory, string itemType, int numOfItems)
            : base(blockSpriteFactory)
        {
            //Initialize state first
            CurrentState = new HiddenBlockStandardState(this);
            CurrentState.Enter(null);

            //Define the characteristics of a brick block here
            Position     = coordinates;
            CurrentFrame = 0;
            //If additional frames of QuestionBlocks are added, update Columns
            Columns    = 1;
            Rows       = 1;
            LayerDepth = 1;
            Scale      = new Vector2(10, 10);
            Width      = Texture.Width / Columns;
            Height     = Texture.Height / Rows;
            Velocity   = velocity;
            //Particles
            Texture2D        brickTexture = BlockSpriteFactory.GetBlockSprite("brick");
            List <Texture2D> textures     = new List <Texture2D>();

            textures.Add(brickTexture);
            ParticleEngine = new ParticleEngine(textures, Position);

            //Items
            ItemModelFactory = itemModelFactory;
            NumOfItems       = numOfItems;
            ItemType         = itemType;
            //CollisionGrid = collisionGrid;
        }
Пример #3
0
        public WarpPipeItemModel(BlockSpriteFactory blockSpriteFactory, Vector2 coordinates, Vector2 velocity, ItemModelFactory itemModelFactory, string itemType, int numOfItems, CollisionGrid collisionGrid)
            : base(blockSpriteFactory)
        {
            //Constructor for warppipe that hides items
            //Initialize Texture first
            Texture = BlockSpriteFactory.GetBlockSprite("pipetop");

            CurrentState = new WarpPipeEntityStandardState(this);
            CurrentState.Enter(null);
            //Define the characteristics of a pipe block here
            Position     = coordinates;
            CurrentFrame = 0;
            Columns      = 1;
            Rows         = 1;
            LayerDepth   = 1;
            Scale        = new Vector2(10, 10);
            Width        = Texture.Width / Columns;
            Height       = Texture.Height / Rows;
            Velocity     = velocity;

            //Items
            ItemModelFactory    = itemModelFactory;
            NumOfItems          = numOfItems;
            ItemType            = itemType;
            CollisionGrid       = collisionGrid;
            ItemModel           = itemModelFactory.GetItemModel(ItemType, coordinates, Velocity);
            ItemModel.IsVisible = false;
        }
        //CollisionGrid CollisionGrid;
        public BrickBlockWithItemModel(BlockSpriteFactory blockSpriteFactory, Vector2 coordinates, Vector2 velocity, ItemModelFactory itemModelFactory, string itemType, int numOfItems)
            : base(blockSpriteFactory)
        {
            //If the Brick block has an Item
            //Initialize state first
            CurrentState = new BrickBlockWithItemStandardState(this);
            CurrentState.Enter(null);

            IBlockStates previousState = CurrentState;

            CurrentState = new BlockHasItemState(this);
            CurrentState.Enter(previousState);
            //Define the characteristics of a brick block here
            Position     = coordinates;
            CurrentFrame = 0;
            Columns      = 1;
            Rows         = 1;
            LayerDepth   = 1;
            Scale        = new Vector2(10, 10);
            Width        = Texture.Width / Columns;
            Height       = Texture.Height / Rows;
            Velocity     = velocity;

            //Particles
            Texture2D        brickTexture = BlockSpriteFactory.GetBlockSprite("brick");
            List <Texture2D> textures     = new List <Texture2D>();

            textures.Add(brickTexture);
            ParticleEngine = new ParticleEngine(textures, Position);

            //Items
            ItemModelFactory = itemModelFactory;
            NumOfItems       = numOfItems;
            ItemType         = itemType;
            //CollisionGrid = collisionGrid;
            ItemModel           = itemModelFactory.GetItemModel(ItemType, coordinates, Velocity);
            ItemModel.IsVisible = false;
        }