CodingTrain / CodingTrain/Wave-Function-Collapse

Encoding tiles symmetry and rotation

未關閉
#14 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
218
分支
64
PR 合併指標
30 天內沒有已合併 PR

描述

The base implementation notes that you can "Augment pattern data with rotations and reflections."
I don't think you need reflections for the circuit problem but you might run into it with more complex setup.

Let's assume you don't need reflections.
For rotations you need to have 4 letters that indicate the orientation of the piece.

For this issue let's call them :
- S -> straight
- L -> rotated 90° to the left
- F -> "flipped" but really it's rotated 180°
- R -> rotated 90° to the right

So this tile :
![4](https://user-images.githubusercontent.com/6383717/165170799-f486d23f-3919-4be4-bdf1-70ce30269eaf.png)

would have edges 4S, 2, 4S, 0

And this one :
![5](https://user-images.githubusercontent.com/6383717/165170893-5cb8e058-7ba7-48ba-b9ca-49da56452140.png)

would have : 4S, 1, 1, 4R

Now the complicated bit is that you have to account for that whenever you are rotating a piece.
For a Left (90°) rotation :
- every S becomes L
- every L becomes F
- every F becomes R
- every R becomes S

This also fixes the problem of having 5.png left edge connecting to a 4S the wrong way because it will never be a 4S AND a top facing edge at the same time.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

先閱讀基礎實作,並追蹤圖塊圖樣資料在哪裡進行旋轉。編碼四個方向 S、L、F 和 R,並驗證旋轉一個區塊會一致地更新每個方向,且不會加入鏡像。完成標準是:每次旋轉後,所描述的邊緣組合仍保持正確對齊。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
game-dev
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。