/// <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);
     // TODO: use this.Content to load your game content here
     spark = Content.Load<Texture2D>("spark.png");
     splittersystem = new SplitterSystem(spark); //Creates a new instance of splittersystem
     camera.setFieldSize(graphics.GraphicsDevice.Viewport);
 }
        public Applicationview(ContentManager _content,Camera _camera,SpriteBatch _spritebatch)
        {
            content = _content;
            camera = _camera;
            spritebatch = _spritebatch;

            splittertexture = content.Load<Texture2D>("spark");
            smoketexture = content.Load<Texture2D>("smoke");
            explosiontexture = content.Load<Texture2D>("explosion");
            shockwavetexture = content.Load<Texture2D>("Shockwave");

            splittersystem = new SplitterSystem(splittertexture, spritebatch, camera, scale, startpos);
            smokesystem = new Smokesystem(smoketexture, spritebatch, camera, startpos);

            explosion = new Explosion(explosiontexture, spritebatch, camera, scale, startpos);
            shockwave = new Shockwave(shockwavetexture, spritebatch, camera, startpos);
        }
예제 #3
0
        public Applicationview(ContentManager _content, Camera _camera, SpriteBatch _spritebatch)
        {
            content     = _content;
            camera      = _camera;
            spritebatch = _spritebatch;

            splittertexture  = content.Load <Texture2D>("spark");
            smoketexture     = content.Load <Texture2D>("smoke");
            explosiontexture = content.Load <Texture2D>("explosion");
            shockwavetexture = content.Load <Texture2D>("Shockwave");

            splittersystem = new SplitterSystem(splittertexture, spritebatch, camera, scale, startpos);
            smokesystem    = new Smokesystem(smoketexture, spritebatch, camera, startpos);

            explosion = new Explosion(explosiontexture, spritebatch, camera, scale, startpos);
            shockwave = new Shockwave(shockwavetexture, spritebatch, camera, startpos);
        }
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }
            // TODO: Add your update logic here
            if (Keyboard.GetState().IsKeyDown(Keys.R))
            {
                splittersystem = new SplitterSystem(spark); //Creates a new instance so a new explosion is created
            }

            foreach (SplitterParticle particle in splittersystem.particles) //Moves the particles
            {
                particle.Updateposition((float)gameTime.ElapsedGameTime.TotalSeconds);
            }
            base.Update(gameTime);
        }