Example #1
0
    // Use this for initialization
    void Start()
    {
        shipExplodeAnim = GetComponent<Animator>();
        gameScene = FindObjectOfType<GameScene>();
        sfxManager = FindObjectOfType<SFXManager>();
        wave = gameScene.GetWave();
        difficulty = PlayerPrefsManager.GetDifficulty();
        DetermineHealth();

        string gameMode = PlayerPrefsManager.GetGameMode();
        {
            if(gameMode == "Boss")
            {
                repeatFireRate = 2.0f - (0.1f * wave);
            }
            else
            {
                repeatFireRate = 2.0f - (0.01f * wave);
            }
        }

        InvokeRepeating("NextDestination",0f,1.0f);
        InvokeRepeating("EnemyFire",0f,repeatFireRate);

        scoreManager = GameObject.FindObjectOfType<ScoreManager>();
    }
    // Use this for initialization
    void Start()
    {
        shipExplodeAnim = GetComponent<Animator>();
        shipCollider = GetComponent<PolygonCollider2D>();
        gameScene = FindObjectOfType<GameScene>();
        sfxManager = FindObjectOfType<SFXManager>();
        wave = gameScene.GetWave();
        difficulty = PlayerPrefsManager.GetDifficulty();
        DetermineHealth();

        camera = Camera.main;
        distance = transform.position.z - camera.transform.position.z;
        xmin = camera.ViewportToWorldPoint(new Vector3(0,0,distance)).x + padding;
        xmax = camera.ViewportToWorldPoint(new Vector3(1,1,distance)).x - padding;

        repeatFireRate = 2.5f - (0.01f * wave);
        laserSpeed = 3.0f + (0.03f * wave);
        InvokeRepeating("NextDestination",0f,1.0f);
        InvokeRepeating("EnemyFire",0f,repeatFireRate);

        scoreManager = GameObject.FindObjectOfType<ScoreManager>();
    }