# 回転させる

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

![](/files/-LAM1Dts8skuUV8KSmwG)

次はテトロミノを回転させてみましょう。もしも回転後に衝突するようならば、回転は失敗します。

## (1) 回転する

![](/files/-LAM1DucDAYXT-70-KDD)

90度回転するには、以下の式で計算できます。

```
回転後のy = -回転前のx
回転後のx = 回転前のy;
```

-90度回転する場合は、以下です。

```
回転後のy = 回転前のx
回転後のx = -回転前のy;
```

## (2) Spaceキーを押すと回転する

![](/files/-LAM1DvpAJIogff2HqIR)

## (3) 確認する

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

![](/files/-LAM1DwQt9PFqmLPAZ2h)

### (3-1) 右上(みぎうえ)の緑色(みどりいろ)の旗(はた)をクリックする。

### (3-2) Spaceキーを押すとテトロミノが回転すること


---

# 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/tetris/rotate_right.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.
