feat: rotate shape when UP is pressed.
This commit is contained in:
parent
6131b751e5
commit
4ce5b82b25
1 changed files with 7 additions and 0 deletions
7
main.go
7
main.go
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue