Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Danger")
     {
         health.KillPlayer("Hit a danger tile");
         camera.RestartLevelCamera();
         ground.BuildPlatform();
     }
 }
Beispiel #2
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            health.KillPlayer("Player is dead!");
            RestartLevelCamera();
            ground.BuildPlatform();
        }

        if (collision.gameObject.tag == "Plain" ||
            collision.gameObject.tag == "Danger" ||
            collision.gameObject.tag == "Score" ||
            collision.gameObject.tag == "Jump")
        {
            ground.RemoveTileFromList(collision.gameObject);
        }
    }
Beispiel #3
0
    private void Awake()
    {
        // init objects
        ground = Object.FindObjectOfType <GroundTileManager>();
        health = Object.FindObjectOfType <PlayerHealth>();
        menuH  = Object.FindObjectOfType <MenuHandler>();
        game   = Object.FindObjectOfType <DDOLGameManager>();

        initTime = Time.time;

        // run functions to draw / build screen
        // set game difficulty
        ground.SetComplexity((GroundTileManager.ETileComplexity)game.gameDifficulty[0].optionValue);

        // build & initialise
        ground.BuildPlatform();
        health.InitialisePlayer();
        health.DrawHeartPrefabs(canvas);

        pauseScreen.SetActive(false);
        Time.timeScale = 1f;
    }