10 lines
230 B
GDScript3
10 lines
230 B
GDScript3
|
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
|