Example #1
0
        // ==============================
        // Properties
        // ==============================
        /// <summary>
        /// Attempts to change the game's state.
        /// </summary>
        void PerformStateChange()
        {
            bool validSwitch = ForceStateChange;

            OldState = State;
            State = State.PerformStateChange();

            if (State != OldState) {
                // TODO: Start a tween
            }
        }
Example #2
0
        protected override void LoadContent()
        {
            // ==============================
            // -- Prepare graphic systems
            // ==============================
            spriteBatch = new SpriteBatch(GraphicsDevice);
            particleSystem = new ParticleSystem();
            primitiveRenderer = new PrimitiveRenderer(spriteBatch);

            // ==============================
            // -- Object pre-initialization
            // ==============================
            particle = new Particle(particle1SpriteSheet);
            beam = new Particle(beam1SpriteSheet);

            // ==============================
            // -- Load fonts
            // ==============================
            sysFont = Content.Load<SpriteFont>(@"Fonts\System");
            // ==============================
            // -- Load graphics
            // ==============================
            fighterSpriteSheet.Texture = Content.Load<Texture2D>(@"Sprites\Fighter1");
            particle1SpriteSheet.Texture = Content.Load<Texture2D>(@"Particles\Particle1");
            beam1SpriteSheet.Texture = Content.Load<Texture2D>(@"Particles\Beam1");
            bulletSpriteSheet.Texture = Content.Load<Texture2D>(@"Sprites\bullet");
            // ==============================
            // -- Object post-initialization
            // =============================
            LoadTracks();

            State = new TitleState(this, sysFont);
        }