1
0
Fork 0

feat: rotate shape when UP is pressed.

This commit is contained in:
Henrik Hautakoski 2025-09-15 06:54:54 +02:00
parent 6131b751e5
commit 4ce5b82b25

View file

@ -50,6 +50,13 @@ func LockShape() {
}
func Update(delta float32) {
if rl.IsKeyPressed(rl.KeyUp) {
rotated := shape.RotateCW()
if !game.CheckShapeCollision(shape_pos, &rotated, &grid) {
shape = rotated
}
}
if moveTimer.UpdateReset(delta) && (rl.IsKeyDown(rl.KeyLeft) || rl.IsKeyDown(rl.KeyRight)) {
new_pos := shape_pos
if rl.IsKeyDown(rl.KeyLeft) {