Esempio n. 1
0
        protected override void Initialize()
        {
            //Components
            Components.Add(new FPS(this, "Fonts\\Arial-10", new Vector2(Window.ClientBounds.Width / 2f, 0))); //Show FPS
            Components.Add(new ParticleSystem(this)); //do almost everything with particles
            //Sprites
            cursor = new Sprite(Content); //mouse icon
            player = new Player(Content);
            //Bocks
            block = new Brick(Content);
            button = new Button(Content);
            pspawner = new SmokeSpawner(null,Content);
            blockSet[0] = block;
            blockSet[1] = button;
            blockSet[2] = pspawner;

            base.Initialize();
        }
Esempio n. 2
0
 public Block getBlock(int index)
 {
     Block Block;
     switch (index)
     {
         case 0:
             Block = new Brick(Content);
             Block.LoadTexture("Block", new Vector2(0), new Vector2(16));
             Block.ScaleX(new Vector2(4));
             break;
         case 1:
             Block = new Button(Content);
             Block.LoadTexture("Button", new Vector2(0), new Vector2(32,16),new Vector2(2,1));
             Block.ScaleX(new Vector2(4));
             break;
         case 2:
             Block = new SmokeSpawner(r, Content);
             Block.LoadTexture("smoke", Vector2.Zero, new Vector2(16), new Vector2(8, 1));
             Block.ScaleX(new Vector2(4));
             Block.color = Color.Black;
             Block.color *= .1f;
             break;
         default:
             Block = null;
             break;
     }
     return Block;
     
 }