Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length >= 1 && Directory.Exists(args[0]))
            {
                string path = args[0];

                MapReader.MapReader mapReader = new MapReader.MapReader(path);
                Storyboard          storyboard;

                if (args.Length == 2)
                {
                    var beatmap = mapReader.GetBeatmap(args[1]);
                    storyboard = beatmap.Storyboard;
                }
                else
                {
                    storyboard = mapReader.GetStoryboard();
                }

                AnalyseSB(storyboard);
            }
            else
            {
                Console.WriteLine("Invalid arguments. Expecting <Path To Mapfolder> <optional: difficultyname>.");
                Console.WriteLine(@"Sample: OsbConsoleInterpreter.exe ""C:\Program Files\osu!\Songs\527869 Toromaru - Enigma"" for .osb SB");
                Console.WriteLine(@"Sample: OsbConsoleInterpreter.exe ""C:\Program Files\osu!\Songs\527869 Toromaru - Enigma"" ""NOVICE"" for .osu SB");
            }
        }
Exemplo n.º 2
0
        public void onInit(String mapPath)
        {
            this.Name = Shared.Macros.S_BASIC;

            Components.Add(Grid.Grid.getInst());

            MapReader.MapReader reader = new MapReader.MapReader(mapPath);
            reader.onInit(resourceManager);
            List<IGameEntity> entities = reader.Read();
            if (entities != null)
            {
                for (int i = 0; i < entities.Count; ++i)
                {
                    entities[i].onInit();
                    GameManager.Add(entities[i]);
                }
            }

            spr = (Sprite)resourceManager.GetResource<ISprite>(Shared.Resources.sand_green_road);

            backgroundLine = (Texture2D)resourceManager.GetResource<Texture2D>(Shared.Resources.BackgroundGame);

            // Create game info
            infoFont = (SpriteFont)resourceManager.GetResource<SpriteFont>(Shared.Resources.Time_Font);
            numberBomber = new Vector2(26f, 0f);
            numberEnemy = new Vector2(756f, 0f);
            clock = new Vector2(183f, -1f);
            scores = new Vector2(400f, -1f);
            gold = new Vector2(596f, -1f);

            // Create bomber
            BomberEntity bomberEntity = new BomberEntity(this.Game);
            bomberEntity.onInit();
            bomberEntity.RendererObj.Position = new Vector2(Global.Bomber_Start_Position_X, Global.Bomber_Start_Position_Y);
            GameManager.Add(bomberEntity);
            InputLayer.Add(bomberEntity);
            Global.Counter_Bomber++;

            // Set target bomber for enemy
            for (int i = 0; i < entities.Count; ++i)
            {
                if (entities[i] is ChasingEnemyEntity)
                {
                    (entities[i] as ChasingEnemyEntity).Target = bomberEntity;
                }
            }
            entities.Clear();

            Components.Add(InputLayer);

            s_background = resourceManager.GetResource<SCSEngine.Audio.Sound>(Global.RandomBackgroundSong());
            services.AudioManager.PlaySound(s_background, true, Global.isMusicOff, Global.isMusicZuneOff);
            s_background.IsLooped = true;

            Global.Counter_Time = 0;
        }