# 機雷発射機能を作る

<https://scratch.mit.edu/projects/78601124/#player>

## (1) 機雷(きらい)を追加(ついか)する

![](/files/-LAM0ym14ku6zRcsT6e-)

### (1-1) 左下(ひだり)のキャラクターアイコンをクリックする

![](/files/-LAM0ym_Z8mXFCIkI3a1)

### (1-2)「もの」をクリック

### (1-3)「Button5」をクリック

### (1-4) 右下(みぎした)のOKをクリック

## (2) 魚雷(ぎょらい)を発射(はっしゃ)するスクリプトを追加(ついか)する

![](/files/-LAM0yn_c6fTWc_N_ZtV)

### (2-1) 左下(ひだりした)のButton5をクリックする

### (2-2) 右上(みぎのうえ)のスクリプトタブをクリック

### (2-3) 下記(かき)スクリプトを追加(ついか)してください

![](/files/-LAM0yooPA1k2eHVFvKG)

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

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

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

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

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

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

<https://scratch.mit.edu/projects/78601124/#player>

![](/files/-LAM0ysqLx8uPPhS4Iuq)

### (3-1) 右上(むぎうえ)の緑色(みどりいろ)の旗(はた)をクリックしてください。

### (3-2) aキーを押(お)すと機雷(きらい)が発射(はっしゃ)されることを確認(かくにん)してください


---

# 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/spacewar/create_fire.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.
