Exemplo n.º 1
0
        public void SetGameOver(int roundScore)
        {
            AnalyticsService.LogEvent("Game_Over_Score", "Score", roundScore);

            enemySpanwer.SetActive(false);

            SaveGameTimeExperience();

            dashBtn.gameObject.SetActive(false);
            dashSlider.gameObject.SetActive(false);

            enemySpanwer.SetActive(false);
            prizeSpawner.SetActive(false);
            btnUp.SetActive(false);
            btnDown.SetActive(false);
            btnLeft.SetActive(false);
            btnRight.SetActive(false);
            pauseButton.gameObject.SetActive(false);
            FindObjectOfType <BackgroundManager_new>().gameObject.SetActive(false);

            this.finalScore               = roundScore;
            screenShotScore.text          = roundScore.ToString();
            matchFinalScoreValueText.text = roundScore.ToString();

            //Save in case of highScore
            HighScoreService.SaveNewScore(roundScore);

            //Load highest score
            bestHighScoreValueText.text = HighScoreService.GetHighestScore().ToString();

            StartCoroutine(ShowGameOverPanel(roundScore));
        }
Exemplo n.º 2
0
    void Awake()
    {
        dbPath = "URI=file:" + Application.persistentDataPath + "/database.db";

        HighScoreService highScoreService = new HighScoreService(dbPath);
        List <HighScore> highScores       = highScoreService.List();

        Image[] highScoreRows = highScoreList.GetComponentsInChildren <Image>();

        int i = 0;

        foreach (HighScore highScore in highScores)
        {
            Debug.Log("name: " + highScore.GetName() + "; score: " + highScore.GetScore());
            for (; i < highScoreRows.Length && !highScoreRows[i].gameObject.CompareTag("HighScoreRow"); i++)
            {
                ;
            }
            if (i < highScoreRows.Length)
            {
                Text[] highScoreFields = highScoreRows[i].gameObject.GetComponentsInChildren <Text>();
                highScoreFields[0].text = highScore.GetName();
                highScoreFields[1].text = highScore.GetScore().ToString();
                i++;
            }
        }
    }
Exemplo n.º 3
0
    private void persistScore(string name, long value)
    {
        string dbPath = "URI=file:" + Application.persistentDataPath + "/database.db";

        Debug.Log("dbPath: " + dbPath);
        HighScoreService highScoreService = new HighScoreService(dbPath);

        highScoreService.Insert(name, value);
    }
Exemplo n.º 4
0
        public void PostScoreAndShowLeaderBoard()
        {
            var finalScore = scoreManager.GetFinalScore();

            if (finalScore < HighScoreService.GetHighestScore())
            {
                finalScore = HighScoreService.GetHighestScore();
            }
            GoogleGamePlayService.PostScore(finalScore, () => ShowLeaderBoard());
        }
 public CommandParser()
 {
     this.menuService             = new MenuService();
     this.gameService             = new GameService();
     this.currentTetrominoService = new CurrentTetrominoService();
     this.menuService             = new MenuService();
     this.boardOutputService      = new BoardOutputService();
     this.tetrominoService        = new TetrominoService();
     this.userService             = new UserService();
     this.boardService            = new BoardService();
     this.highScoreService        = new HighScoreService();
 }
Exemplo n.º 6
0
    string addScoreURL       = "clawindiegames.square7.ch/addscore.php?"; //be sure to add a ? to your url

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
    void Awake()
    {
        dbPath = "URI=file:" + Application.persistentDataPath + "/database.db";
        Debug.Log("dbPath: " + dbPath);

        HighScoreService highScoreService = new HighScoreService(dbPath);

        highScoreService.CreateTable();
        if (highScoreService.List().Count < 10)
        {
            for (int i = 10; i > 0; i--)
            {
                highScoreService.Insert(i % 2 == 0 ? "GIT" : "GUD", i * 1000);
            }
        }
    }
Exemplo n.º 8
0
 public ShowHighScoresCommand(MenuService menuService, HighScoreService highScoreService)
 {
     this.menuService      = menuService;
     this.highScoreService = highScoreService;
 }
        // GET: HighScore
        public ActionResult Index()
        {
            List <HighScore> listHighScore = new HighScoreService().getHighScoreList();

            return(View(listHighScore));
        }
Exemplo n.º 10
0
 public HighScoreServiceTest()
 {
     _highScoreService = new HighScoreService(_highScoreRepo.Object);
 }
Exemplo n.º 11
0
 public ScoreController(HighScoreService highScores)
 {
     this.highScores = highScores;
 }