Esempio n. 1
0
 public GameView(Texture2D spark, Texture2D smoke, Texture2D explosion, Rectangle gameWindow, Vector2 startPosition)
 {
     this.spark         = spark;
     this.smoke         = smoke;
     this.explosion     = explosion;
     this.gameWindow    = gameWindow;
     this.startPosition = startPosition;
     sparkSystem        = new SparkSystem(startPosition);
     smokeSystem        = new SmokeSystem(startPosition);
     explosionSystem    = new ExplosionSystem(startPosition);
 }
Esempio n. 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spark       = Content.Load <Texture2D>("spark");
            smoke       = Content.Load <Texture2D>("particlesmoke");
            explosion   = Content.Load <Texture2D>("explosion");
            //Vector2 startPosition = new Vector2(graphics.GraphicsDevice.Viewport.Bounds.Width / 2.0f, graphics.GraphicsDevice.Viewport.Bounds.Height / 2.0f);
            camera = new Camera(graphics.GraphicsDevice.Viewport);
            Vector2 startPosition = new Vector2(0.5f, 0.5f);

            gameWindow = camera.GetGameWindow();
            gameView   = new GameView(spark, smoke, explosion, gameWindow, startPosition);
            ss         = new SmokeSystem();
            gameView.Initiate();


            // TODO: use this.Content to load your game content here
        }
Esempio n. 3
0
 public void Initiate()
 {
     sparkSystem     = new SparkSystem(startPosition);
     smokeSystem     = new SmokeSystem(startPosition);
     explosionSystem = new ExplosionSystem(startPosition);
 }