Compare commits

...

9 Commits

Author SHA1 Message Date
Elijah Voigt 4c35daac3e Tests pass so we are... almost cooking 6 days ago
Elijah Voigt 0d1a680625 Starting on shape-is-matrix implementation 1 week ago
Elijah Voigt 7ef5a73704 not perfect, but gooder movement 1 week ago
Elijah Voigt c4394f9728 Moving in the right direction for movement checking 2 weeks ago
Elijah Voigt c21636629e Initial clear line code, untested 2 weeks ago
Elijah Voigt f0d41f15ee Potential logic fix 2 weeks ago
Elijah Voigt f6aae11f8c Hit detection not working, but not horribly broken either... somewhere in between. 2 weeks ago
Elijah Voigt 2cab218e5c Tighten up tetrino grid movement 2 weeks ago
Elijah Voigt b51884ac69 Moved away from childof relationship!
Instead of using ChildOf, which has Transform implications, we created
our own relationship:

    ShapeBlocks(Vec<Entity>) <-> BlockOf { parent: Entity }

This relationship just informs how to place blocks with a
RelativePosition near their GridPosition parents without having to deal
with the Transform of the parent.
2 weeks ago

@ -0,0 +1,45 @@
# Design
## Tetris
Matrix Multiplication for rotating pieces.
Each piece (shape) contains a Mat4 containing a representation of it's shape.
For example:
```
0 1 0 0
0 1 0 0
0 1 0 0
0 1 0 0
```
This is the classic `line` piece.
And here it is on it's `up` side
```
0 0 0 0
1 1 1 1
0 0 0 0
0 0 0 0
```
And here is the `t` piece
```
0 1 0
1 1 1
0 0 0
```
A matrix multiplication is applied to this Mat6 to achieve a piece rotation.
When that matrix is updated, the 4 blocks parented to the shape are moved to reflect this new shape.
This matrix also allows us to do checks to see if any of the blocks in the shape would intersect with another piece on the board.
We can also check if a piece would go out of bounds during a move or rotation.
We can use this to "plan -> validate -> commit" changes based on user input.
Question: How the fuck do matrix multiplications work??

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save