Exemple #1
0
        /// <summary>
        /// Update
        /// </summary>
        public override void Update()
        {
            base.Update();

            mPlayerOne.Update();
            mPlayerTwo.Update();
            mFlagOne.Update();
            mFlagTwo.Update();

            if (mWinningPlayer != 0)
            {
                if (mTimeoutUntilReset > 0)
                {
                    mTimeoutUntilReset -= Time.deltaTime;

                    if (mTimeoutUntilReset <= 0)
                    {
                        SceneTitle scene = new SceneTitle();
                        scene.Initialize();
                        var game = (SuperFlagRun)RB.Game;
                        game.SwitchScene(scene);
                    }
                }
            }
        }
        /// <summary>
        /// Initialize
        /// </summary>
        /// <returns>True if successful</returns>
        public bool Initialize()
        {
            assets.LoadAll();

            if (!LoadMap())
            {
                return(false);
            }

            RB.MusicVolumeSet(0.5f);
            RB.MusicPlay(assets.musicGame);

            SceneTitle scene = new SceneTitle();

            scene.Initialize();

            SwitchScene(scene);

            RB.EffectSet(RB.Effect.Scanlines, 0.25f);
            RB.EffectSet(RB.Effect.Noise, 0.05f);

            if (!mStandalone)
            {
                RB.PresentDisable();
            }

            return(true);
        }
Exemple #3
0
        /// <summary>
        /// Initialize
        /// </summary>
        /// <returns>True if successful</returns>
        public bool Initialize()
        {
            RB.SpriteSheetSetup(SPRITESHEET_SPRITES, "Demos/SuperFlagRun/Sprites", new Vector2i(16, 16));
            RB.SpriteSheetSetup(SPRITESHEET_TITLE, "Demos/SuperFlagRun/SpritesTitle", new Vector2i(16, 16));
            RB.SpriteSheetSetup(SPRITESHEET_TERRAIN, "Demos/SuperFlagRun/TilemapTerrain", new Vector2i(16, 16));
            RB.SpriteSheetSetup(SPRITESHEET_DECO, "Demos/SuperFlagRun/TilemapDeco", new Vector2i(16, 16));

            RB.SpriteSheetSet(SPRITESHEET_SPRITES);

            RB.FontSetup(GAME_FONT, 'A', 'Z', new Vector2i(0, 130), 0, new Vector2i(12, 12), 6, 1, -1, false);

            if (!LoadMap())
            {
                return(false);
            }

            RB.SoundSetup(SOUND_JUMP, "Demos/SuperFlagRun/Jump");
            RB.SoundSetup(SOUND_PICKUP_FLAG, "Demos/SuperFlagRun/Pickup");
            RB.SoundSetup(SOUND_DROP_FLAG, "Demos/SuperFlagRun/DropFlag");
            RB.SoundSetup(SOUND_START_GAME, "Demos/SuperFlagRun/StartGame");
            RB.SoundSetup(SOUND_FOOT_STEP, "Demos/SuperFlagRun/FootStep");

            RB.MusicSetup(0, "Demos/SuperFlagRun/Music/GoLucky");
            RB.MusicVolumeSet(0.5f);
            RB.MusicPlay(0);

            SceneTitle scene = new SceneTitle();

            scene.Initialize();

            SwitchScene(scene);

            RB.EffectSet(RB.Effect.Scanlines, 0.25f);
            RB.EffectSet(RB.Effect.Noise, 0.05f);

            if (!mStandalone)
            {
                RB.PresentDisable();
            }

            return(true);
        }