예제 #1
0
    void CreateStage(string stageDefinition)
    {
        Debug.Log("creating stage:\n" + stageDefinition);
        StageCreator stageCreator = new StageCreator(stageDefinition, character, getStageTiles(), getStageDoodads());

        stageCreator.CreateStage();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        SongID00 = StageSlect.SongID00;
        Debug.Log(SongID00);
        EndScore = 0;
        if (TestMode)
        {
            KeyDownEffect.Reflection = true;
            MusicStage = Stage;

            Offset   += 0.25f;
            NoteSpeed = Speed;
            Debug.Log(NoteSpeed);
            StageSet();
            GameStart();
        }
        else if (isDemo)
        {
            Stage     = Demo[Random.Range(0, Demo.Count - 1)];
            NoteSpeed = 30;
            Autoplay  = true;
            StageSet();
            Invoke("GameStart", 8);
        }
        else
        {
            Stage = MusicStage;
            StageSet();
            Offset += 0.25f;
            Invoke("GameStart", 8);
        }
        //Debug.Log(MovingNotes.Speed);
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        isArrowed = false;

        mode        = MODE.TITLE;
        titleselect = 0;

        if (cam == null)
        {
            cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraControl>();
            cam.gameObject.AddComponent <ChangeShader>();
        }

        if (controller == null)
        {
            GameObject CO = new GameObject();
            CO.name    = "Controller";
            controller = CO.gameObject.AddComponent <Controller>();
            controller.SetCamera(cam.GetComponent <CameraControl>());
        }
        if (stage == null)
        {
            stage = FindObjectOfType <StageCreator>();
        }

        ObjectManager.StartUpData();
        DataBaseManager.SetUpObjectData();
        stage.Initialize();
        ObjectInstance();
        //GrowPlant.CreateGrowPlant("nat_001",new Vector3(),5);

        //Sound
    }
예제 #4
0
 private void LoadStageDefinitions()
 {
     stageInfo = new List <StageCreator.StageMetadata>();
     foreach (TextAsset stageFile in stageFiles)
     {
         StageCreator.StageMetadata metadata = StageCreator.GetStageMetadata(stageFile.text);
         stageInfo.Add(metadata);
     }
 }
예제 #5
0
        public GamePlay(GameDevice gameDevice)
        {
            this.gameDevice = gameDevice;

            inputState   = gameDevice.GetInputState;
            stageCreator = new StageCreator(gameDevice);
            stageLoader  = new C_StageLoader(gameDevice);

            isPause = false;
            stageNo = 1;
        }
예제 #6
0
파일: MinerGame.cs 프로젝트: pecea/Miner
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            SpriteBatch = new SpriteBatch(GraphicsDevice);

            var stage = StageCreator.Create(this, StageLevel.One);

            Camera = new Camera2D(this, stage.Player.Drawing);

            Components.Add(stage);
            Components.Add(Camera);

            base.Initialize();
        }
예제 #7
0
    public override void SetupLevelSettings()
    {
        PlayerStartPosition = new Vector3(0, 0, 0);
        Stages    = new Stage[3];
        Stages[0] = StageCreator.CreateStage(new Vector3(3, 3, 0), 20, 2, 16);
        Stages[1] = StageCreator.CreateStage(new Vector3(9, 0, 0), 20, 2, 15);
        Stages[2] = StageCreator.CreateStage(new Vector3(-4, -12, 0), 20, 20, 1200, CoreParametersCreator.CreateCoreParameters(2500, 5, 20));

        ForceObjectStartSpawnParameters = new ForceObjectStartSpawnParameters();
        ForceObjectStartSpawnParameters.DefendersCount = 3;
        ForceObjectStartSpawnParameters.ExplodersCount = 3;
        ForceObjectStartSpawnParameters.ImplodersCount = 3;
    }
예제 #8
0
 public void LoadStage(int index)
 {
     if (index >= 0 && index < stageFiles.Count)
     {
         UnloadStage();
         StageCreator stageCreator = new StageCreator(stageFiles[index].text, character, tiles, doodads);
         this.currentStage      = stageCreator.CreateStage();
         this.currentStageIndex = index;
     }
     else
     {
         throw new System.Exception("Stage index not in range.");
     }
 }
예제 #9
0
 public void LaunchModules()
 {
     InstantiateModule     = MainController.Instance.ModuleCreator.Create <InstantiateModule>   ("InstantiateModule");
     PoolModule            = MainController.Instance.ModuleCreator.Create <PoolModule>          ("PoolModule");
     PrefabCollection      = MainController.Instance.ModuleCreator.Create <PrefabCollection>    ("PrefabCollection");
     ObjectSpawner         = MainController.Instance.ModuleCreator.Create <ObjectSpawner>       ("ObjectSpawner");
     LevelCollection       = new LevelCollection();
     LevelLoader           = new LevelLoader();
     TimeingManager        = new TimeingManager();
     InputModuleUIMode     = new InputModuleUIMode();
     InputModulePlayMode   = new InputModulePlayMode();
     StageCreator          = new StageCreator();
     CoreParametersCreator = new CoreParametersCreator();
     PointSystemCreator    = new PointSystemCreator();
 }
예제 #10
0
        static void Main(string[] args)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(StageCreator));
            var           stage      = new StageCreator()
            {
                Player = new GameObjectInitializer {
                    X = 0, Y = 300, Texture = "Textures\\Player\\player", Shape = new Polygon(new[] { new Vector2(0, 0), new Vector2(0, 10), new Vector2(10, 0) })
                },
                Size = new Vector2(1200, 600),
            };

            var t = new List <GameObjectInitializer>();

            for (var i = 0; i < 38; i++)
            {
                t.Add(new GameObjectInitializer {
                    X = i * 32, Y = 568, Texture = "Textures\\terrain", Shape = new Polygon(new[] { new Vector2(0, 0), new Vector2(0, 32), new Vector2(32, 32), new Vector2(32, 0) })
                });
            }

            for (var i = 0; i < 10; i++)
            {
                t.Add(new GameObjectInitializer {
                    X = i * 32, Y = 536, Texture = "Textures\\terrain", Shape = new Polygon(new[] { new Vector2(0, 0), new Vector2(0, 32), new Vector2(32, 32), new Vector2(32, 0) })
                });
            }
            t.Add(new GameObjectInitializer {
                X = 10 * 32, Y = 536, Texture = "Textures\\terrain_nw_se", Shape = new Polygon(new[] { new Vector2(0, 0), new Vector2(0, 32), new Vector2(32, 32) })
            });
            t.Add(new GameObjectInitializer {
                X = 27 * 32, Y = 536, Texture = "Textures\\terrain_sw_ne", Shape = new Polygon(new[] { new Vector2(0, 32), new Vector2(32, 32), new Vector2(32, 0) })
            });

            for (var i = 28; i < 38; i++)
            {
                t.Add(new GameObjectInitializer {
                    X = i * 32, Y = 536, Texture = "Textures\\terrain", Shape = new Polygon(new[] { new Vector2(0, 0), new Vector2(0, 32), new Vector2(32, 32), new Vector2(32, 0) })
                });
            }

            stage.Terrain = t.ToArray();

            StreamWriter writer = new StreamWriter(@"C:\Users\Piotr\Source\Repos\Miner\Miner\Miner\MinerContent\StageLevels\one.xml");

            serializer.Serialize(writer, stage);
            writer.Close();
        }
예제 #11
0
    // Use this for initialization
    void Start()
    {
        UpdateComplete = true;
        TestMode       = true;
        EndScore       = 0;
        if (TestMode)
        {
            KeyDownEffect.Reflection = true;
            MusicStage = Stage;

            Offset   += 0.25f;
            NoteSpeed = Speed;
            Debug.Log(NoteSpeed);
            StageSet();
            GameStart();
        }
        //Debug.Log(MovingNotes.Speed);
    }
예제 #12
0
    private static void Init()
    {
        StageCreator stageCreator = (StageCreator)GetWindow(typeof(StageCreator));

        stageCreator.Show();
    }
예제 #13
0
    // Use this for initialization
    void Start()
    {
        Retry = 0;
        //TotalResult.Totals.Add(TotalNeed[StageSlect.Track - 1]);
        CD = 6;
        StageCreator s = StageManager.MusicStage;

        if (Music.musicInf.songID == 0)
        {
            Dif.color = new Color(0.8531394f, 0, 1, 0.454902f);
            //TotalResult.Totals[StageSlect.Track - 1].dif = 2;
        }
        else
        {
            if (s == Music.musicInf.Difficulty[0])
            {
                Dif.color = new Color(0.4862745f, 1, 0, 0.454902f);
                //TotalResult.Totals[StageSlect.Track - 1].dif = 0;
                Difficult = 0;
            }
            else if (s == Music.musicInf.Difficulty[1])
            {
                Dif.color = new Color(1, 0, 0, 0.454902f);
                //TotalResult.Totals[StageSlect.Track - 1].dif = 1;
                Difficult = 1;
            }
            else
            {
                Dif.color = new Color(0.8531394f, 0, 1, 0.454902f);
                //TotalResult.Totals[StageSlect.Track - 1].dif = 2;
                Difficult = 2;
            }
        }

        SongImage.sprite = s.Stage.SongImage;
        SongName.text    = s.Stage.SongName;
        Author.text      = s.Stage.Author;
        Score.text       = ((int)(StageManager.Score * Zeroto1)).ToString();
        Perfect.text     = "Perfect : " + (int)(StageManager.Perfect * Zeroto1);
        Good.text        = "Good : " + (int)(StageManager.Good * Zeroto1);
        Miss.text        = "Miss : " + (int)(StageManager.Miss * Zeroto1);
        MaxCombo.text    = "MaxCombo : " + (int)(StageManager.MaxCombo * Zeroto1);
        HoldBouns.text   = "HoldBouns : " + (int)(StageManager.HoldBouns * Zeroto1);


        /*
         * TotalResult.Totals[StageSlect.Track - 1].Author.text = Author.text;
         * TotalResult.Totals[StageSlect.Track - 1].BPM.text = "BPM " + s.Stage.BPM.ToString();
         *
         * TotalResult.Totals[StageSlect.Track - 1].Level.text = "LV " + s.Stage.level.ToString();
         * TotalResult.Totals[StageSlect.Track - 1].Score.text = StageManager.Score.ToString();
         * TotalResult.Totals[StageSlect.Track - 1].SongImage.sprite = SongImage.sprite;
         * TotalResult.Totals[StageSlect.Track - 1].SongName.text = SongName.text;
         */

        if (StageManager.Miss == 0)
        {
            FC.SetActive(true);
            //TotalResult.Totals[StageSlect.Track - 1].FC = true;
            if (LoginManager.Login)
            {
                if (Music.musicInf.songID == 0 && !LoginManager.Save.PandoraFC[StageSlect.Pan])
                {
                    LoginManager.Save.PandoraFC[StageSlect.Pan] = true;
                    DataUpdate = true;
                }
                else
                {
                    if (Difficult == 0 && !LoginManager.Save.EasyFC[Music.musicInf.songID])
                    {
                        LoginManager.Save.EasyFC[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                    if (Difficult == 1 && !LoginManager.Save.HardFC[Music.musicInf.songID])
                    {
                        LoginManager.Save.HardFC[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                    if (Difficult == 2 && !LoginManager.Save.ExtraFC[Music.musicInf.songID])
                    {
                        LoginManager.Save.ExtraFC[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                }
            }
        }

        if (StageManager.Miss == 0 && StageManager.Good == 0)
        {
            P.SetActive(true);
            //TotalResult.Totals[StageSlect.Track - 1].Perfect = true;
            if (LoginManager.Login)
            {
                if (Music.musicInf.songID == 0 && !LoginManager.Save.PandoraPerfect[StageSlect.Pan])
                {
                    LoginManager.Save.PandoraPerfect[StageSlect.Pan] = true;
                }
                else
                {
                    if (Difficult == 0 && !LoginManager.Save.EasyPerfect[Music.musicInf.songID])
                    {
                        LoginManager.Save.EasyPerfect[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                    if (Difficult == 1 && !LoginManager.Save.HardPerfect[Music.musicInf.songID])
                    {
                        LoginManager.Save.HardPerfect[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                    if (Difficult == 2 && !LoginManager.Save.ExtraPerfect[Music.musicInf.songID])
                    {
                        LoginManager.Save.ExtraPerfect[Music.musicInf.songID] = true;
                        DataUpdate = true;
                    }
                }
            }
        }
        else
        {
            int Score = StageManager.Score;
            if (Score >= 980000)
            {
                SS.SetActive(true);
            }
            else if (Score >= 920000)
            {
                S.SetActive(true);
            }
            else if (Score >= 840000)
            {
                A.SetActive(true);
            }
            else if (Score >= 780000)
            {
                B.SetActive(true);
            }
            else if (Score >= 700000)
            {
                C.SetActive(true);
            }
            else if (Score >= 600000)
            {
                D.SetActive(true);
            }
            else
            {
                F.SetActive(true);
            }
        }

        if (LoginManager.Login)
        {
            if (Music.musicInf.songID == 0)
            {
                if (LoginManager.Save.PandoraHighScore[StageSlect.Pan] < StageManager.Score)
                {
                    LoginManager.Save.PandoraHighScore[StageSlect.Pan] = StageManager.Score;
                    DataUpdate = true;
                }
            }
            else
            {
                if (Difficult == 0)
                {
                    if (LoginManager.Save.EasyHighScore[Music.musicInf.songID] < StageManager.Score)
                    {
                        LoginManager.Save.EasyHighScore[Music.musicInf.songID] = StageManager.Score;
                        DataUpdate = true;
                    }
                }
                if (Difficult == 1)
                {
                    if (LoginManager.Save.HardHighScore[Music.musicInf.songID] < StageManager.Score)
                    {
                        LoginManager.Save.HardHighScore[Music.musicInf.songID] = StageManager.Score;
                        DataUpdate = true;
                    }
                }
                if (Difficult == 2)
                {
                    if (LoginManager.Save.ExtraHighScore[Music.musicInf.songID] < StageManager.Score)
                    {
                        LoginManager.Save.ExtraHighScore[Music.musicInf.songID] = StageManager.Score;
                        DataUpdate = true;
                    }
                }
            }
        }
    }