Exemplo n.º 1
0
        public void MoveToTitleScreen(EntityCommandBuffer cb)
        {
            HideInventory(cb);

            // Record every player move at title screen
            var pis = EntityManager.World.GetExistingSystem <PlayerInputSystem>();

            pis.StartRecording();

            // Start with a nice new seed
            CurrentSeed = MakeNewRandom();
            RandomRogue.Init(CurrentSeed);

            // Clear the screen.
            Entities.WithAll <Player>().ForEach((Entity player, ref GoldCount gc, ref ExperiencePoints xp) =>
            {
                _scoreManager.SetHiScores(gc.count + xp.now + (CurrentLevel - 1) * 10);
            });
            ClearView(cb);

            if (GlobalGraphicsSettings.ascii)
            {
                GameView.Blit(cb, new int2(0, 0), "TINY ROGUE");
                GameView.Blit(cb, new int2(30, 20), "PRESS SPACE TO BEGIN");
                GameView.Blit(cb, new int2(30, 21), "PRESS H FOR HISCORES");
            }
            else
            {
                var glog = EntityManager.World.GetExistingSystem <GraphicalLogSystem>();
                glog.AddToLog("TINY ROGUE");
                glog.AddToLog("PRESS SPACE TO BEGIN");
            }

            _state = eGameState.Title;
        }
Exemplo n.º 2
0
        void MoveToReplay(EntityCommandBuffer cb)
        {
            var pis = EntityManager.World.GetExistingSystem <PlayerInputSystem>();

            pis.StartReplaying();

            // Init at the start of the current seed again
            RandomRogue.Init(CurrentSeed);

            MoveToInGame(cb);
        }