void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.gameObject.tag == "Enemy" || coll.gameObject.tag == "Hole")
     {
         PlayerPrefs.SetString("points", pointController.GetPoints());
         SceneManager.LoadScene(2, LoadSceneMode.Single);
     }
 }
Example #2
0
    public void Update()
    {
        if (gameState == GameState.Gaming)
        {
            if (altitudeText != null)
            {
                altitudeText.text = "Health: " + Mathf.FloorToInt(currentAirShip.altitudeInMeters);
            }
            if (scoreText != null)
            {
                scoreText.text = "Points: " + pointController.GetPoints();
            }


            CheckGameOver();
        }
    }
 public void EndGame()
 {
     Destroy(this.Player.gameObject);
     _endGame          = true;
     Time.timeScale    = 0;
     EndScoreText.text = "Score: " + _pointController.GetPoints();
     GameOverPanel.gameObject.SetActive(true);
 }
Example #4
0
        public void getAllPoints200()
        {
            newUser = _tu.CreateUserObject();
            Session newSession = _tu.CreateSessionObject(newUser);

            _tu.CreateSessionInDb(newSession);

            //Uncomment to add mock data
            //for (int i = 1; i < 11; i++)
            //{
            //    float num = (float)(i * .1);
            //    Point newPoint = _tu.CreatePointObject(10 + num, -1 * (10 + num));
            //    _tu.CreatePointInDb(newPoint);
            //    Console.WriteLine(newPoint.Id);
            //}


            var endpoint = API_ROUTE_LOCAL + "/api/points/";

            controller.Request = new HttpRequestMessage
            {
                RequestUri = new Uri(endpoint)
            };

            var request = new HttpRequestMessage();

            request.Headers.Add("minLng", "10");
            request.Headers.Add("maxLng", "11");
            request.Headers.Add("minLat", "-11");
            request.Headers.Add("maxLat", "-10");
            request.Headers.Add("token", newSession.Token);

            controller.Request = request;

            var response = controller.GetPoints();

            Assert.AreEqual(response.StatusCode, System.Net.HttpStatusCode.OK);
        }