Cambiados los aspectos visuales del juego a algo gotico
This commit is contained in:
1 parent
ec7e35ddf6
commit
967b3a286d
205 files changed
+7056
-1630
No files matched your search
@@ -26,6 +26,8 @@ const DROP_COLLECTION_DELAY_SECONDS: float = 0.75
|
||||
@export var bob_amplitude: float = 4.0
|
||||
## Velocidad angular de esa oscilacion.
|
||||
@export var bob_speed: float = 3.0
|
||||
## Solo presentacion: los nombres aparecen al acercarse al objeto.
|
||||
@export_range(32.0, 320.0, 2.0) var label_visibility_radius: float = 110.0
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var time: float = 0.0
|
||||
@@ -33,6 +35,7 @@ var start_y: float = 0.0
|
||||
var grounded: bool = false
|
||||
var _can_collect: bool = false
|
||||
var _pending_collector: Node2D # Jugador que toco el objeto durante la espera.
|
||||
var _label_viewer: Node2D
|
||||
|
||||
@onready var label: Label = $Label
|
||||
@onready var sprite: Sprite2D = $Sprite2D
|
||||
@@ -44,6 +47,7 @@ func _ready() -> void:
|
||||
_update_preview()
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
label.visible = false
|
||||
add_to_group("pickup")
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
@@ -82,6 +86,7 @@ func _enable_collection_after_delay() -> void:
|
||||
func _physics_process(delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
_update_label_proximity()
|
||||
time += delta
|
||||
if not grounded:
|
||||
velocity.y += fall_speed * delta
|
||||
@@ -153,3 +158,12 @@ func _get_configuration_warnings() -> PackedStringArray:
|
||||
if pickup_data == null:
|
||||
return PackedStringArray(["Asigna Pickup Data o arrastra una escena de pickups/variants."])
|
||||
return PackedStringArray()
|
||||
|
||||
|
||||
## Nombres y avisos de recogida permanecen legibles cerca del personaje sin
|
||||
## llenar el horizonte de etiquetas. El editor conserva todas las etiquetas.
|
||||
func _update_label_proximity() -> void:
|
||||
if not is_instance_valid(_label_viewer):
|
||||
_label_viewer = get_tree().get_first_node_in_group(&"player") as Node2D
|
||||
label.visible = is_instance_valid(_label_viewer) and \
|
||||
global_position.distance_squared_to(_label_viewer.global_position) <= label_visibility_radius * label_visibility_radius
|
||||
Reference in new issue
Block a user