input
This commit is contained in:
parent
574e22ef74
commit
1359d6555a
@ -95,35 +95,35 @@ func _on_Stats_level_up():
|
|||||||
if $Stats.level > 15:
|
if $Stats.level > 15:
|
||||||
$LockDelay.wait_time = 0.5 * pow(0.9, $Stats.level-15)
|
$LockDelay.wait_time = 0.5 * pow(0.9, $Stats.level-15)
|
||||||
|
|
||||||
func _process(delta):
|
func _unhandled_input(event):
|
||||||
if Input.is_action_just_pressed("pause"):
|
if event.is_action_pressed("pause"):
|
||||||
if playing:
|
if playing:
|
||||||
pause()
|
pause()
|
||||||
$controls_ui.visible = true
|
$controls_ui.visible = true
|
||||||
elif $controls_ui.enable_resume:
|
elif $controls_ui.enable_resume:
|
||||||
resume()
|
resume()
|
||||||
if Input.is_action_just_pressed("toggle_fullscreen"):
|
if event.is_action_pressed("toggle_fullscreen"):
|
||||||
OS.window_fullscreen = !OS.window_fullscreen
|
OS.window_fullscreen = !OS.window_fullscreen
|
||||||
if playing:
|
if playing:
|
||||||
for action in movements:
|
for action in movements:
|
||||||
if action == autoshift_action:
|
if action == autoshift_action:
|
||||||
if not Input.is_action_pressed(action):
|
if event.is_action_released(action):
|
||||||
$AutoShiftDelay.stop()
|
$AutoShiftDelay.stop()
|
||||||
$AutoShiftTimer.stop()
|
$AutoShiftTimer.stop()
|
||||||
autoshift_action = ""
|
autoshift_action = ""
|
||||||
else:
|
else:
|
||||||
if Input.is_action_pressed(action):
|
if event.is_action_pressed(action):
|
||||||
autoshift_action = action
|
autoshift_action = action
|
||||||
process_autoshift_action()
|
process_autoshift_action()
|
||||||
$AutoShiftTimer.stop()
|
$AutoShiftTimer.stop()
|
||||||
$AutoShiftDelay.start()
|
$AutoShiftDelay.start()
|
||||||
if Input.is_action_just_pressed("hard_drop"):
|
if event.is_action_pressed("hard_drop"):
|
||||||
hard_drop()
|
hard_drop()
|
||||||
if Input.is_action_just_pressed("rotate_clockwise"):
|
if event.is_action_pressed("rotate_clockwise"):
|
||||||
rotate(Tetromino.CLOCKWISE)
|
rotate(Tetromino.CLOCKWISE)
|
||||||
if Input.is_action_just_pressed("rotate_counterclockwise"):
|
if event.is_action_pressed("rotate_counterclockwise"):
|
||||||
rotate(Tetromino.COUNTERCLOCKWISE)
|
rotate(Tetromino.COUNTERCLOCKWISE)
|
||||||
if Input.is_action_just_pressed("hold"):
|
if event.is_action_pressed("hold"):
|
||||||
hold()
|
hold()
|
||||||
|
|
||||||
func _on_AutoShiftDelay_timeout():
|
func _on_AutoShiftDelay_timeout():
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user