mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 12:55:20 +01:00
Enhance: Improve game mechanics and visuals in GameView and GameBoard
- Increased glow effect and adjusted border properties for better visual appeal. - Updated block size calculation to ensure proper fitting within the view. - Modified rotation logic in GameBoard to include advanced wall kick mechanics for smoother gameplay. - Adjusted piece spawning to start from the top row and refined hold mechanics. - Added getter and setter for rotation index in Tetromino for better encapsulation.
This commit is contained in:
parent
04b87e8f19
commit
9bef4bf003
3 changed files with 170 additions and 101 deletions
|
@ -17,6 +17,21 @@ class Tetromino(val type: TetrominoType) {
|
|||
var x = 0
|
||||
var y = 0
|
||||
|
||||
/**
|
||||
* Get the current rotation index (0-3)
|
||||
*/
|
||||
fun getRotationIndex(): Int {
|
||||
return currentRotation
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current rotation index (0-3)
|
||||
* Internal visibility allows access within the same module (e.g., from GameBoard)
|
||||
*/
|
||||
internal fun setRotationIndex(index: Int) {
|
||||
currentRotation = index.coerceIn(0, 3) // Ensure value stays within 0-3
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current shape of the tetromino based on rotation
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue