コード例 #1
0
ファイル: NoisEvader.UI.cs プロジェクト: sk-zk/NoisEvader
        private void LevelSelectScreen_ReplaySelected(object sender, CachedLevelData cld,
                                                      string replayId)
        {
            var level = new SoundodgerLevel(cld.XmlPath);

            LoadReplayAndStart(level, replayId, cld.Settings);
        }
コード例 #2
0
ファイル: NoisEvader.UI.cs プロジェクト: sk-zk/NoisEvader
        private void RestartCurrentLevel()
        {
            audioPlayer.Stop();
            var level = new SoundodgerLevel(Arena.Level.XmlPath);

            SwitchToArenaAndStart(level, Arena.ActiveMod, Arena.LevelSettings);
        }
コード例 #3
0
ファイル: NoisEvader.UI.cs プロジェクト: sk-zk/NoisEvader
        public void SwitchToArenaAndStart(SoundodgerLevel level, Mod mods, LevelSettings settings)
        {
            logger.Info("Level selected: {artist} - {title} by {designer} ({hash})",
                        level.Info.Artist, level.Info.Title, level.Info.Designer, level.XmlHash);
            Arena = new Arena(inputHelper);
            InitArena(Arena);
            Desktop.Root.Visible = false;
            IsMouseVisible       = false;
            SetVsync(Config.GameSettings.Vsync);
            try
            {
                Arena.LoadLevelAndStart(level, mods, settings);
                gameState = GameState.PlayingLevel;
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Level failed to load");
#if DEBUG
                throw;
#else
                SwitchToLevelSelectScreen();
                ShowErrorMessage("The level failed to load.\nCheck the game log for details.");
#endif
            }
        }
コード例 #4
0
 protected override Spawner ConstructSpawner(SoundodgerLevel level)
 {
     return(new LiveSpawner()
     {
         Arena = arena,
         BorderColor = level.Info.Colors.Outline,
     });
 }
コード例 #5
0
ファイル: ShotCreator.cs プロジェクト: sk-zk/NoisEvader
 public ShotCreator(Vector2 arenaCenter, float arenaRadius, SoundodgerLevel level,
                    List <StreamShot> activeStreams, CircleParticleSystem particles)
 {
     this.arenaRadius   = arenaRadius;
     this.arenaCenter   = arenaCenter;
     Level              = level;
     this.activeStreams = activeStreams;
     this.particles     = particles;
 }
コード例 #6
0
ファイル: ArenaSpawners.cs プロジェクト: sk-zk/NoisEvader
 public void CreateIndicatorList(SoundodgerLevel level)
 {
     foreach (var shot in level.Script.Shots)
     {
         foreach (var enemyIdx in shot.Enemies)
         {
             Util.GetSpawnerFromShotIndex(Spawners, enemyIdx)
             .AddToIndicatorList(
                 shot.Time, shot.Color);
         }
     }
 }
コード例 #7
0
ファイル: ArenaSpawners.cs プロジェクト: sk-zk/NoisEvader
        protected virtual void ConstructSpawners(SoundodgerLevel level)
        {
            var amount = level.Info.Enemies;
            var ceil   = (int)Math.Ceiling(amount);

            Spawners = new List <Spawner>(ceil);

            for (int i = 0; i < ceil; i++)
            {
                Spawner spawnerCircle = ConstructSpawner(level);
                SetLastShot(level, i, spawnerCircle);
                Spawners.Add(spawnerCircle);
            }
        }
コード例 #8
0
ファイル: BulletManager.cs プロジェクト: sk-zk/NoisEvader
        public BulletManager(ArenaCircle arena, SoundodgerLevel level,
                             List <Spawner> spawners, Mod activeMods, CircleParticleSystem particles)
        {
            this.arena     = arena;
            shotCreator    = new ShotCreator(arena.Circle.Center, arena.Circle.Radius, level, ActiveStreams, particles);
            Shots          = new List <Shot>(level.Script.Shots);
            this.spawners  = spawners;
            this.activeMod = activeMods;
            this.particles = particles;
            this.level     = level;
            bulletDrawer   = new BulletDrawer(Bullets);

            shotIterator = new TimeIter <Shot>(Shots, x => x.Time, OnFireShot);
        }
コード例 #9
0
ファイル: ArenaSpawners.cs プロジェクト: sk-zk/NoisEvader
        protected void SetLastShot(SoundodgerLevel level, int i, Spawner spawner)
        {
            var lastShot = level.Script.Shots.LastOrDefault(
                x => x.Enemies.Contains(i));

            if (lastShot is null)
            {
                spawner.DespawnPoint = 0f;
            }
            else
            {
                spawner.DespawnPoint = (float)lastShot.Time;
                if (lastShot is StreamShot ss)
                {
                    spawner.DespawnPoint += (float)ss.Duration;
                }
            }
        }
コード例 #10
0
ファイル: ArenaSpawners.cs プロジェクト: sk-zk/NoisEvader
        protected virtual Spawner ConstructSpawner(SoundodgerLevel level)
        {
            Spawner spawner;

            if (useCenterSpawnerGlitch)
            {
                spawner = new CenterGlitchSpawner();
            }
            else
            {
                spawner = new Spawner();
            }

            spawner.Arena       = arena;
            spawner.BorderColor = level.Info.Colors.Outline;
            spawner.Center      = Vector2.Zero;

            return(spawner);
        }
コード例 #11
0
ファイル: NoisEvader.UI.cs プロジェクト: sk-zk/NoisEvader
        public void LoadReplayAndStart(SoundodgerLevel level, string replayId, LevelSettings settings)
        {
            logger.Info("Replay selected: {replayId} for {artist} - {title} by {designer} ({hash})",
                        replayId, level.Info.Artist, level.Info.Title, level.Info.Designer, level.XmlHash);

            Arena = new ReplayArena(inputHelper);
            InitArena(Arena);
            Desktop.Root.Visible = false;
            IsMouseVisible       = false;
            SetVsync(Config.GameSettings.Vsync);
            try
            {
                var replay = Replay.Open(Path.Combine(Replay.ReplaysDir, replayId));
                (Arena as ReplayArena).LoadReplayAndStart(level, replay, settings);
                gameState = GameState.PlayingLevel;
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Replay failed to load");
                SwitchToLevelSelectScreen();
                ShowErrorMessage("The replay failed to load.\nCheck the game log for details.");
            }
        }
コード例 #12
0
ファイル: ArenaSpawners.cs プロジェクト: sk-zk/NoisEvader
 public void CreateSpawners(SoundodgerLevel level)
 {
     useCenterSpawnerGlitch = level.UsesCenterSpawnerGlitch;
     ConstructSpawners(level);
     SetSpawnerAngles(level.Info.Enemies);
 }
コード例 #13
0
ファイル: NoisEvader.UI.cs プロジェクト: sk-zk/NoisEvader
        private void LevelSelectScreen_LevelSelected(object sender, CachedLevelData cld, Mod mods)
        {
            var level = new SoundodgerLevel(cld.XmlPath);

            SwitchToArenaAndStart(level, mods, cld.Settings);
        }