12 lines
370 B
GDScript3
12 lines
370 B
GDScript3
|
extends Sprite
|
||
|
|
||
|
class_name ScatterCard
|
||
|
|
||
|
func tweenTo(targetPos: Vector2, targetRot: float, duration: float = 1.0):
|
||
|
$Tween.interpolate_property(self, "position",
|
||
|
position, targetPos, duration,
|
||
|
Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
|
||
|
$Tween.interpolate_property(self, "rotation",
|
||
|
rotation, targetRot, duration,
|
||
|
Tween.TRANS_CUBIC, Tween.EASE_IN_OUT)
|
||
|
$Tween.start()
|