CodingTrain / CodingTrain/Wave-Function-Collapse
Encoding tiles symmetry and rotation
- Langage dominant
- JavaScript
- Étoiles
- 218
- Forks
- 64
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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 :

would have edges 4S, 2, 4S, 0
And this one :

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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par lire l’implémentation de base et suivez l’endroit où les données du motif de tuile sont pivotées. Encodez les quatre orientations S, L, F et R, puis vérifiez que la rotation d’une pièce met à jour chaque orientation de manière cohérente sans ajouter de réflexions. C’est terminé lorsque les combinaisons de bords décrites restent correctement alignées après chaque rotation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- game-dev
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100