Exemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            splitterSystem = new SplitterSystem(ExplosionScale);
            smokeSimulator = new SmokeSimulator();
            explosionUpdater = new ExplosionUpdater(splitterSystem, smokeSimulator);
            explosionView = new ExplosionView(GraphicsDevice, Content, explosionUpdater, splitterSystem, smokeSimulator);

            System.Timers.Timer aTimer;
            aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(ResetExplosion);
            aTimer.Interval = 2500;
            aTimer.Enabled = true;
        }
        public ExplosionView(GraphicsDevice device, ContentManager content, ExplosionUpdater explosionUpdater, SplitterSystem splitterSystem, SmokeSimulator smokeSimulator)
        {
            this.explosionUpdater = explosionUpdater;
            this.device = device;

            camera = new Camera(device);
            this.splitterSystem = splitterSystem;
            this.smokeSimulator = smokeSimulator;

            spriteBatch = new SpriteBatch(device);

            explosionTexture = content.Load<Texture2D>("explosion.png");
            particleTexture = content.Load<Texture2D>("spark.png");
            smokeTexture = content.Load<Texture2D>("particlesmoke.png");
        }