feat: soft drop
This commit is contained in:
parent
f7df74aeaa
commit
8f11a99e08
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
|
@ -50,6 +50,12 @@ func LockShape() {
|
|||
}
|
||||
|
||||
func Update(delta float32) {
|
||||
if rl.IsKeyPressed(rl.KeyDown) {
|
||||
dropTimer.SetInterval(0.05)
|
||||
} else if rl.IsKeyReleased(rl.KeyDown) {
|
||||
dropTimer.SetInterval(0.3)
|
||||
}
|
||||
|
||||
if rl.IsKeyPressed(rl.KeyUp) {
|
||||
rotated := shape.RotateCW()
|
||||
if !game.CheckShapeCollision(shape_pos, &rotated, &grid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue