> For the complete documentation index, see [llms.txt](https://mose-byun.gitbook.io/epl_game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mose-byun.gitbook.io/epl_game/undefined-2/undefined-1.md).

# 블록 코딩

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FZ0snLWFIzR42erwfWmkp%2Fimage.png?alt=media\&token=29016fb0-22d1-45cf-9d32-972504677752)

우리가 추가한 건반 오브젝트들에 각각 소리를 추가하여

오브젝트를 클릭했을 때 소리가 날 수 있도록 프로그램을 만들어 봅시다

{% tabs %}
{% tab title="소리 추가하기" %}

#### <mark style="background-color:green;">1. 피아노건반</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">도<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">오브젝트를 선택 합니다</mark>

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FBdmGr0lkaQ3mIviIZLaZ%2Fimage.png?alt=media\&token=09966200-4084-4ae7-a13b-8d19d18cd071)

#### <mark style="background-color:green;">2. 블록 꾸러미에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">소리<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">탭을 선택하여 소리 추가하기 버튼을 눌러 줍니다</mark>

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2Fh8YyiZwQ5U3MqcQqEYyS%2Fimage.png?alt=media\&token=8e08bc8b-181a-4e17-a6af-98f8b78292fc)

####

#### <mark style="background-color:green;">3. 악기 탭을 선택하여</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">마림바\_04가온도<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">소리를 선택, 추가 버튼을 눌러 추가해 줍니다</mark>

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FnNYkjLQacIY3sg49nuUH%2Fimage.png?alt=media\&token=cd479d13-872a-484e-b364-d6d5d8fe30b8)

####

#### <mark style="background-color:green;">4. 추가한 소리를 재생 버튼을 눌러 확인해 봅니다</mark>

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FfWYd5SJDpdmC73Owq39t%2Fimage.png?alt=media\&token=40760621-7d1d-4256-9560-e0b9719b56ba)
{% endtab %}

{% tab title="오브젝트 클릭 연주" %}

#### <mark style="background-color:green;">1. 시작메뉴에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">`오브젝트를 클릭했을 때`<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">블록을 찾아 블록 조립소 화면에 가져와 줍니다</mark>

#### <mark style="background-color:green;">소리메뉴에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">`소리(대상없음) 재생하기`<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">블록을 찾아 오브젝트를 클릭했을 때 아래에 연결하여 줍니다</mark>

<figure><img src="https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2F3ODVYtfL3xoQbtQoInui%2Fimage.png?alt=media&amp;token=ffacbcab-f5bf-4bf7-a27b-cd0b754973b4" alt=""><figcaption><p>대상없음 부분을 클릭하여 추가한 소리로 변경해 줍니다</p></figcaption></figure>

####

#### <mark style="background-color:green;">2. 생김새 메뉴에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">`피아노건반_도 모양으로 바꾸기`<mark style="color:red;"></mark> <mark style="background-color:green;"></mark><mark style="background-color:green;">블록을 찾아 소리재생하기 블록 아래에 연결해 줍니다</mark>

<figure><img src="https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FVa1Te9DeFgByzOZQ2tcN%2Fimage.png?alt=media&amp;token=53f3c624-18ae-4d5d-abf9-ac6c38a31c01" alt=""><figcaption><p>피아노건반_도 부분을 클릭하여 피아노건반_도1로 변경해 줍니다</p></figcaption></figure>

####

#### <mark style="background-color:green;">3. 흐름 메뉴에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">`2초 기다리기 블록`<mark style="color:red;"></mark><mark style="background-color:green;">을 찾아 모양으로 바꾸기 블록 아래에 연결한 후</mark>&#x20;

#### <mark style="background-color:green;">2초를 0.1초로 변경해 줍니다</mark>&#x20;

<figure><img src="https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FiD5gyVYvPReryqBTAz6n%2Fimage.png?alt=media&amp;token=0c06546a-d40d-400a-aced-2e972acc88e2" alt=""><figcaption><p>(숫자 부분을 클릭 후 숫자 입력)</p></figcaption></figure>

####

#### <mark style="background-color:green;">4. 생김새 메뉴에서</mark> <mark style="background-color:green;"></mark><mark style="background-color:green;"><mark style="color:red;">`모양으로 바꾸기 블록`<mark style="color:red;"></mark><mark style="background-color:green;">을 찾아 0.1초 기다리기 블록 아래에 연결해 줍니다</mark>&#x20;

#### <mark style="background-color:green;">동일하게 이름을 피아노건반\_도 로 변경해 줍니다</mark>

<figure><img src="https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2FKKabj6cAw8P1NoWrkFgl%2Fimage.png?alt=media&amp;token=9db2f13f-7268-4130-91d0-d0c91bbe15f5" alt=""><figcaption></figcaption></figure>

나머지 건반 오브젝트들도 동일한 방법으로 소리와 모양을 변경하여 만들어 줍니다
{% endtab %}

{% tab title="키보드 키로 연주" %}

#### 시작 메뉴에서 <mark style="color:red;">**`q키를 눌렀을 때`**</mark> 블록을 찾아 건반 블록 코딩 1과 동일하게 블록을 찾아 연결해 줍니다&#x20;

#### q키 부분을 클릭하여 a로 선택하여 변경해 줍니다 (원하는 키로 변경 가능)

![](https://1531256047-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXvbbV6aKzba7LAYYrKx8%2Fuploads%2F5DYV3TgS1oDUYWZi0p9z%2Fimage.png?alt=media\&token=118c680a-bb24-4477-bb8f-968b5a737305)

나머지 음 이름들도 앞에서 만든 연주 블록을 복사하여 연주하기 편한&#x20;

키보드의 키 이름으로 변경하여 완성해 줍니다
{% endtab %}
{% endtabs %}
