changing random rotation offset to depend on card text
This commit is contained in:
parent
6457d123e3
commit
9f0e65effc
|
|
@ -4,7 +4,7 @@ extends Area2D
|
|||
class_name Card
|
||||
var compatible_postits: Array[PostIt] = []
|
||||
var own_postits: Array[PostIt] = []
|
||||
var wiggle_pos: float = randf_range(-100, 100)
|
||||
var wiggle_pos: float = 0
|
||||
var wiggle_intensity: float = 0
|
||||
var noise: Noise = FastNoiseLite.new()
|
||||
var wiggle_tween
|
||||
|
|
@ -16,8 +16,10 @@ var scale_tween
|
|||
if is_inside_tree() or Engine.is_editor_hint():
|
||||
$Label.text = value
|
||||
$BackgroundSprite.frame = text.hash() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation)
|
||||
if is_inside_tree():
|
||||
$BackgroundSprite.void_active = value == ""
|
||||
wiggle_pos = float(text.hash() % 100)
|
||||
if is_inside_tree() and value == "":
|
||||
$BackgroundSprite.void_active = true
|
||||
_handle_wiggle(0)
|
||||
@export var wiggle_strength: float = 0.2
|
||||
@export var wiggle_speed: float = 5
|
||||
@export_range(1, 2) var scale_bump: float = 1.05
|
||||
|
|
@ -50,7 +52,7 @@ var scale_tween
|
|||
@export var voice_line: AudioStream = null
|
||||
|
||||
func _ready():
|
||||
_handle_wiggle(0)
|
||||
|
||||
if not Engine.is_editor_hint() and is_inside_tree():
|
||||
for postit in self.get_children():
|
||||
if postit is PostIt: self.own_postits.append(postit as PostIt)
|
||||
|
|
@ -64,8 +66,11 @@ func _ready():
|
|||
own_postits[0].sibling = own_postits[1]
|
||||
own_postits[1].sibling = own_postits[0]
|
||||
|
||||
$BackgroundSprite.frame = randi() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation)
|
||||
$BackgroundSprite.frame = text.hash() % $BackgroundSprite.sprite_frames.get_frame_count($BackgroundSprite.animation)
|
||||
$Label.text = self.text
|
||||
|
||||
wiggle_pos = float(text.hash() % 100)
|
||||
_handle_wiggle(0)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue