示例#1
0
 public void SetTime(int time)
 {
     if (TimeAttack.currentState == null)
     {
         TimeAttack.currentState = new TimeAttack();
     }
     TimeAttack.currentState.time = time;
     TimeAttack.Save(TimeAttack.currentState);
 }
示例#2
0
 public void SetDifficulty(int difficulty)
 {
     if (TimeAttack.currentState == null)
     {
         TimeAttack.currentState = new TimeAttack();
     }
     TimeAttack.currentState.difficulty = difficulty;
     TimeAttack.Save(TimeAttack.currentState);
 }
    public void StartGame0(int id)
    {
        TimeAttack.Reset();
        TimeAttack.Save(TimeAttack.currentState);

        System.Random rnd      = new System.Random(id);
        int           sizebase = 4;
        int           sizeex   = (id % 8) * (id / 8) / 2;

        FloorBehaviour.nextSettings = new FloorSettings(id, id, new Vector2Int(sizebase + rnd.Next(0, sizeex), sizebase + rnd.Next(0, sizeex)));
        Scene("GameScene");
    }
示例#4
0
    public void ApplyChallenge()
    {
        var rnd      = new System.Random(TimeAttack.currentState.seed);
        int sizebase = 4;
        int sizeex   = TimeAttack.currentState.difficulty * 8 + TimeAttack.currentState.clearedCount;

        TimeAttack.currentState.currentStage =
            new FloorSettings(TimeAttack.currentState.id, TimeAttack.currentState.seed, new Vector2Int(sizebase + rnd.Next(0, sizeex), sizebase + rnd.Next(0, sizeex)));

        TimeAttack.Save(TimeAttack.currentState);
        ContinuePause();
    }
示例#5
0
    public void Next()
    {
        if (TimeAttack.currentState == null)
        {
            return;
        }

        {
            TimeAttack.currentState.totalCoin += GameStats.currentStats.coin;
            TimeAttack.currentState.totalTime += GameStats.currentStats.time;
            TimeAttack.currentState.totalMiss += GameStats.currentStats.miss;
            TimeAttack.currentState.clearedCount++;
            TimeAttack.currentState.seed++;
            TimeAttack.Save(TimeAttack.currentState);
        }

        GameStats.Reset();
        ApplyChallenge();
    }
示例#6
0
    public void StartChallenge()
    {
        if (TimeAttack.currentState == null)
        {
            TimeAttack.currentState = new TimeAttack();
        }

        {
            TimeAttack.currentState.id           = TimeAttack.currentState.difficulty * 1000 + TimeAttack.currentState.time + 100000;
            TimeAttack.currentState.totalTime    = 0;
            TimeAttack.currentState.totalCoin    = 0;
            TimeAttack.currentState.totalMiss    = 0;
            TimeAttack.currentState.clearedCount = 0;
            TimeAttack.currentState.seed         = new System.Random().Next();
            TimeAttack.Save(TimeAttack.currentState);
        }

        SceneController.lastSelect = "TitleScene";

        GameStats.Reset();
        ApplyChallenge();
    }