예제 #1
0
    // To be called on ticks where the balls are in the middle of a tile
    void ExecuteTickMainTurn()
    {
        foreach (BallBehaviour ball in board.activeBalls)
        {
            TileBehaviour tile = board.GetTileInside(ball);
            if (!tile)
            {
                Debug.LogError("Ball outside board");
                gameState.isPaused = true;
                continue;
            }

            switch (tile.tileType)
            {
            case TileBehaviour.TileType.Vault:
                ball.forward *= -1.0f;
                break;

            default:
                BounceBall(ball);
                break;
            }

            tile.ConditionalBlock(ball.forward);

            if (tile.pickup)
            {
                tile.pickup.PickUp(ball);
            }
        }
    }