♻️REFACTOR: Mejoras en la viabilidad para desarrollo
This commit is contained in:
1 parent
5aba6c7b47
commit
fd0118d964
98 files changed
+5985
-3024
No files matched your search
@@ -4,6 +4,7 @@ class_name DropManager
|
||||
const PICKUP_SCENE := preload("res://pickups/pickup.tscn")
|
||||
|
||||
|
||||
## Sortea una cantidad de objetos sin repetir entradas, usando pesos no negativos.
|
||||
static func roll_drop(drop_table: PickupDropTable) -> Array[PickupData]:
|
||||
var result: Array[PickupData] = []
|
||||
if drop_table == null:
|
||||
@@ -44,10 +45,10 @@ static func roll_drop(drop_table: PickupDropTable) -> Array[PickupData]:
|
||||
return result
|
||||
|
||||
|
||||
## Instancia recompensas desde coordenadas globales y difiere su entrada al arbol.
|
||||
static func spawn_drops(drops_data: Array[PickupData], parent: Node, position: Vector2) -> void:
|
||||
# Death can happen inside a physics collision callback. Adding a new Area2D
|
||||
# immediately at that point is unsafe: defer its entry into the scene tree.
|
||||
# Set its local position first so it never briefly enters at the origin.
|
||||
# La muerte puede ocurrir dentro de un contacto fisico. Se difiere la entrada
|
||||
# del nuevo Area2D al arbol y se prepara antes su posicion local para evitar aparecer en el origen.
|
||||
var local_position: Vector2 = position
|
||||
if parent is Node2D:
|
||||
local_position = (parent as Node2D).to_local(position)
|
||||
|
||||
Reference in new issue
Block a user