# 勝ち負けを判定する

![](/files/-LAM12feYdNmEM0KESY6)

勝(か)ち負(ま)けを判定(はんてい)できるようにしましょう。

## (1) 勝(か)ち負(ま)けを判定(はんてい)するスクリプトを追加(ついか)

### (1-1) ボールSpriteに以下(いか)のスクリプトを追加(ついか)してください

![](/files/-LAM12gAo0PBai-E5XE_)

**※ 「Yの速度(そくど)」変数(へんすう)を作(つく)るときは、「このSpriteのみ」にチェックを入れてください**

**※ 「Xの速度(そくど)」変数(へんすう)を作(つく)るときは、「このSpriteのみ」にチェックを入れてください**

**※ 「赤の得点」変数(へんすう)を作(つく)るときは、「すべてのSpriteよう」にチェックを入れてください**

**※ 「青の得点」変数(へんすう)を作(つく)るときは、「すべてのSpriteよう」にチェックを入れてください**

## (2) 確認(かくにん)してみよう

<https://scratch.mit.edu/projects/78435366/>

![](/files/-LAM12hAJZ7oLRjsOBea)

### (2-1) ボールが左右に壁にぶつかると、得点表示が更新されます。

## (3) Good!

良(よ)くできました。次(つぎ)のステップに進(すすみ)みましょう!!

![](/files/-LAM1-fhNobHTi1Bd5O4)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://firefirebook.firefirestyle.net/pong/win_lose.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
