45193fc27f
- performance improvements - shake effect - keyboard support
9 lines
230 B
GDScript
9 lines
230 B
GDScript
extends Node2D
|
|
|
|
|
|
func shake(intensity):
|
|
var preview_pos = global_position
|
|
for x in range(14):
|
|
global_position.y = randi_range(0-intensity,intensity)
|
|
await get_tree().create_timer(0.02).timeout
|
|
global_position = preview_pos
|