Esempio n. 1
0
    IEnumerator Update_lives_countdown()
    {
        if (current_screen == no_lives_left_screen) //keep update the text only when the page is active
        {
            //if not exist a target time yet, note it now
            if (my_game_master.target_time[my_game_master.current_profile_selected].Year == 0001)
            {
                my_game_master.Set_date_countdown();
                my_game_master.Save(my_game_master.current_profile_selected);
            }

            no_lives_left_countdown.text = my_game_master.Show_how_much_time_left();
            yield return(new WaitForSeconds(1));

            if (my_game_master.current_lives[my_game_master.current_profile_selected] > 0)
            {
                no_lives_left_screen.gameObject.SetActive(false);
                Mark_current_screen(home_screen);
            }
            else
            {
                StartCoroutine(Update_lives_countdown());
            }
        }
    }
Esempio n. 2
0
    void Manage_LivesTimer()
    {
        if (!lives_timer.activeSelf)
        {
            return;
        }

        if (my_game_master.target_time[my_game_master.current_profile_selected].Year == 0001)
        {
            my_game_master.Set_date_countdown(true);
            my_game_master.Save(my_game_master.current_profile_selected);
        }

        lives_timer_text.text = my_game_master.Show_how_much_time_left();

        if (my_game_master.timerStatus == game_master.TimerStatus.done)
        {
            my_game_master.timerStatus = game_master.TimerStatus.Off;
            Update_lives(0);
        }
    }
Esempio n. 3
0
    private void Update()
    {
        //gain extra lives timer
        if (!lives_timer.gameObject.activeSelf)
        {
            return;
        }

        //if not exist a target time yet, note it now
        if (my_game_master.target_time[my_game_master.current_profile_selected].Year == 0001)
        {
            my_game_master.Set_date_countdown(true);
            my_game_master.Save(my_game_master.current_profile_selected);
        }

        lives_timer_text.text = my_game_master.Show_how_much_time_left();

        if (my_game_master.timerStatus == game_master.TimerStatus.done)
        {
            my_game_master.timerStatus = game_master.TimerStatus.Off;
            Update_me();
        }
    }
Esempio n. 4
0
    public void Continue_no(bool call_defeat_screen)
    {
        if (game_uGUI.current_game_uGUI.show_debug_messages)
        {
            Debug.Log("Continue_no()");
        }

        if (call_defeat_screen)
        {
            Time.timeScale = initial_time_scale;
            can_take_input = false;
        }

        if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_W1_Stage_1)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("Reset_all_worlds");
            }

            if (my_game_master.continue_rule_selected == game_master.continue_rule.continue_cost_a_continue_token)
            {
                my_game_master.current_continue_tokens[my_game_master.current_profile_selected] = my_game_master.start_continue_tokens;
            }

            my_game_master.Reset_all_worlds();
        }
        else if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_current_world_Stage_1)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("Reset_current_world if the playar not have already completed it");
            }
            if (my_game_master.current_world[my_game_master.current_profile_selected] == my_game_master.play_this_stage_to_progress_in_the_game_world[my_game_master.current_profile_selected])
            {
                my_game_master.Reset_current_world(my_game_master.current_world[my_game_master.current_profile_selected], true);
                my_game_master.play_this_stage_to_progress_in_the_game_world[my_game_master.current_profile_selected] = my_game_master.current_world[my_game_master.current_profile_selected];
                my_game_master.play_this_stage_to_progress_in_the_game_stage[my_game_master.current_profile_selected] = 0;
            }
        }
        else if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_current_world_and_current_stage)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("restart from here");
            }
        }

        if (my_game_master.when_restart_selected == game_master.when_restart.give_lives_after_countdown)
        {
            my_game_master.Set_date_countdown();
        }

        //my_game_master.current_lives[my_game_master.current_profile_selected] = my_game_master.if_not_continue_restart_with_lives;

        my_game_master.refresh_stage_and_world_screens = true;
        my_game_master.Save(my_game_master.current_profile_selected);

        this.gameObject.SetActive(false);

        if (call_defeat_screen && (my_game_master.lose_lives_selected == game_master.lose_lives.in_game))
        {
            game_uGUI.current_game_uGUI.Defeat();
        }
    }