Beispiel #1
0
    public static int LoadBestRecord(GameSystem.Mode mode, GameSystem.ModeType modeType)
    {
        string finalKey     = string.Format(KeyBestScore, (int)mode, (int)modeType);
        int    defaultValue = (modeType == GameSystem.ModeType.PassLevel ? 1 : 0);

        return(LoadIntValue(finalKey, defaultValue));
    }
Beispiel #2
0
 public static void RequestGameLeaderboard(GameSystem.Mode mode, GameSystem.ModeType modeType, MonoBehaviour target, KTPlayLeaderboard.Callback callback, int startIndex = 0)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
     {
         string leaderboardId = LeaderboardIDs[(int)mode][(int)modeType];
         Debug.Log("request leaderboard ID of game:" + leaderboardId);
         KTPlayLeaderboard.GlobalLeaderboard(leaderboardId, startIndex, Constant.TOP_RANK_COUNT, target, callback);
     }
 }
Beispiel #3
0
    /**
     * (ATAN((POWER(A2;1.4)- I2/2) / (I2/4)) + 1.57) / 3.14 * 110 - 10
     */
    public static int computePercentByScore(GameSystem.Mode mode, GameSystem.ModeType modeType, int score)
    {
        Debug.Log("HighScore:" + HighScores.ToString());
        float param = (float)HighScores[(int)mode][(int)modeType];

        Debug.Log("Param:" + param.ToString());
        int percent = (int)((Mathf.Atan((Mathf.Pow((float)score, 1.1f) - (param / 2.0f)) / (param / 4.0f)) + Mathf.PI / 2.0f) / Mathf.PI * 110.0f - 10.0f);

        return(percent);
    }
Beispiel #4
0
 public static void ReportScore(GameSystem.Mode mode, GameSystem.ModeType modeType, int score)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
     {
         if (KTAccountManager.IsLoggedIn())
         {
             string leaderboardId = LeaderboardIDs[(int)mode][(int)modeType];
             KTPlayLeaderboard.ReportScore(score, leaderboardId, LeaderboardTarget, LeaderboardCallback);
         }
     }
 }
Beispiel #5
0
    public static bool LoadModeUnlock(GameSystem.Mode mode)
    {
        string finalKey = string.Format(KeyModeUnlock, (int)mode);

        if (mode == GameSystem.Mode.Classic || mode == GameSystem.Mode.Dual)
        {
            return(true);
        }
        else
        {
            return(LoadBoolValue(finalKey, false));
        }
    }
Beispiel #6
0
    public static Wave GetPassLevelWaveData(GameSystem.Mode mode, int waveNumber)
    {
        waveNumber = (waveNumber - 1) / 3 + 1;
        int gridLength = 3;

        if (gridLength == 7)
        {
            int finalCount = 0;
            if (waveNumber > 74)
            {
                finalCount = 27;
            }
            else
            {
                finalCount = (gridLength - 1) + (waveNumber - 1 - passLevelCountForLength[gridLength - 4]);
            }
            return(new Wave(gridLength, gridLength, finalCount));
        }

        while (waveNumber > passLevelCountForLength[gridLength - 3] && gridLength != 7)
        {
            gridLength++;
        }

        int blockCount = 0;

        if (gridLength == 3)
        {
            blockCount = (gridLength - 1) + (waveNumber - 1);
        }
        else
        {
            blockCount = (gridLength - 1) + (waveNumber - 1 - passLevelCountForLength[gridLength - 4]);
        }
        return(new Wave(gridLength, gridLength, blockCount));
    }
 public void SetRecommendMode(GameSystem.Mode mode)
 {
     recommendMode = mode;
 }
Beispiel #8
0
    public static void SaveModeUnlock(GameSystem.Mode mode, bool unlock)
    {
        string finalKey = string.Format(KeyModeUnlock, (int)mode);

        SaveBoolValue(finalKey, unlock);
    }
Beispiel #9
0
    public static void SaveBestRecord(GameSystem.Mode mode, GameSystem.ModeType modeType, int record)
    {
        string finalKey = string.Format(KeyBestScore, (int)mode, (int)modeType);

        SaveIntValue(finalKey, record);
    }
Beispiel #10
0
    public static void SaveModeEntered(GameSystem.Mode mode, bool entered)
    {
        string finalKey = string.Format(KeyModeEntered, (int)mode);

        SaveBoolValue(finalKey, entered);
    }
Beispiel #11
0
 public static int HellLevelIndex(GameSystem.Mode mode)
 {
     return(LevelData.wavesInfo[(int)mode].Length - 1);
 }
Beispiel #12
0
 public static int NormalLevelMaxIndex(GameSystem.Mode mode)
 {
     return(LevelData.wavesInfo[(int)mode].Length - 2);
 }