예제 #1
0
파일: Grid.cs 프로젝트: spimpaov/MindTheGap
    void checkIfPlayerCanMoveToTile(int tile_id)
    {
        int player_id = getPlayerID();
        var adj       = player_adj;

        if (Ending.final_breath)
        {
            return;
        }

        if (swap_mode_active && ending_event)
        {
            if (player_id >= 20 && player_id <= 29)
            {
                adj.Add(tiles[player_id - width]);
            }
            if (player_id >= 30 && player_id <= 39 && player_id != 34 && player_id != 35)
            {
                adj.Add(tiles[player_id + width]);
            }
        }

        if (swap_mode_active && ending_event && player_adj.Contains(tiles [tile_id]))
        {
            movePassenger(player_id, tile_id, 0.25f);
            if (AtStation.passengerOnSecondLineOfSeats(tile_id) ||
                AtStation.passengerOnFirstLastLineOfSeats(tile_id))
            {
                End_Game();
            }
        }
    }
예제 #2
0
    void Start()
    {
        audio = AudioManager.Get_Audio_Manager();
        at    = FindObjectOfType <AtStation>();
        grid  = FindObjectOfType <Grid>();
        tm    = FindObjectOfType <TurnManager>();

        // StartCoroutine(Foo());
    }
예제 #3
0
    public IEnumerator Driver_Ending()
    {
        float time = 1f;

        final_breath = true;
        yield return(new WaitForSeconds(time));

        health.Stop_Shake_Player();
        driver.DOLocalMoveY(driver.transform.localPosition.y + 65, time);
        yield return(new WaitForSeconds(time));

        driver.localScale = new Vector3(
            driver.localScale.x * -1,
            driver.localScale.y,
            driver.localScale.z
            );
        yield return(new WaitForSeconds(time));

        var player = GameObject.FindGameObjectWithTag("Player");

        if (AtStation.passengerOnSecondLineOfSeats(grid.getPlayerID()))
        {
            driver.DOMove(player.transform.position - new Vector3(0, 2), time * 5);
            yield return(new WaitForSeconds(time * 5));

            driver.DOMove(player.transform.position - new Vector3(0, 1), time * 5);
            yield return(new WaitForSeconds(time * 5));
        }
        else if (AtStation.passengerOnFirstLastLineOfSeats(grid.getPlayerID()))
        {
            driver.DOMove(player.transform.position + new Vector3(0, 1), time * 10);
            yield return(new WaitForSeconds(time * 10));
        }

        yield return(dialog.Text());

        audio.Play_Real(audio.enya_time);
        yield return(new WaitForSeconds(1.0f));

        yield return(Roll_Credits(player));

        yield return(new WaitForSeconds(3.0f));

        audio.Play(audio.passenger_in, 1f);
        yield return(new WaitForSeconds(0.3f));

        Application.Quit();
    }
예제 #4
0
파일: Grid.cs 프로젝트: spimpaov/MindTheGap
    public List <GameObject> calculateAdj(int id)
    {
        List <GameObject> adj_list = new List <GameObject>();

        if (FindObjectOfType <Player>().getTileId() == id)
        {
            adj_list.Add(tiles[id]); //player eh adj a ele mesmo
        }
        List <int> assentos = getAllSeats();

        if (assentos.Contains(id))
        {
            if (AtStation.passengerOnFirstLineOfSeats(id))
            {
                adj_list.Add(tiles[id + width]);
            }
            else if (AtStation.passengerOnSecondLineOfSeats(id))
            {
                adj_list.Add(tiles[id - width]);

                if (id + width == getPlayerID())
                {
                    adj_list.Add(tiles [id + width * 2]);
                }
                else
                {
                    adj_list.Add(tiles [id + width]);
                }
            }

            if (AtStation.passengerOnFirstLastLineOfSeats(id))
            {
                adj_list.Add(tiles[id - width]);
                adj_list.Add(tiles[id + width]);

                if (id - width == getPlayerID())
                {
                    adj_list.Add(tiles [id - width * 2]);
                }
                else
                {
                    adj_list.Add(tiles [id - width]);
                }
            }
            else if (AtStation.passengerOnSecondLastLineOfSeats(id))
            {
                adj_list.Add(tiles[id - width]);
            }
            return(adj_list);
        }
        if (id % width == 0 || id == 44 || id == 54)
        {
            adj_list.Add(tiles [id + 1]);
        }
        else if (id % width == width - 1 || id == 45 || id == 55)
        {
            adj_list.Add(tiles [id - 1]);
        }
        else
        {
            adj_list.Add(tiles[id - 1]);
            adj_list.Add(tiles[id + 1]);
        }
        if (id < width || (id >= 20 && id < 30))
        {
            adj_list.Add(tiles[id + width]);
        }
        else if (id == 54 || id == 55 || (id >= 30 && id < 34) || (id >= 36 && id < 40))
        {
            adj_list.Add(tiles[id - width]);
        }
        else
        {
            adj_list.Add(tiles[id - width]);
            adj_list.Add(tiles[id + width]);
        }

        return(adj_list);
    }