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:
cmclark00 2025-04-01 23:25:40 -04:00
parent 04b87e8f19
commit 9bef4bf003
3 changed files with 170 additions and 101 deletions

View file

@ -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
*/