New screens, new hud, new intro menu, some UI element changes
This commit is contained in:
+25
-7
@@ -18,18 +18,36 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _spawn() -> void:
|
||||
for pos: Vector3 in _spread_positions(_spawn_count):
|
||||
# Bull and matadors start at opposite ends of a random diameter, so they always
|
||||
# begin as far apart as the arena allows (edge-to-edge across the centre).
|
||||
var arena_r := DP.f("arena_spawn_radius")
|
||||
var bull_angle := randf() * TAU
|
||||
_place_bull(bull_angle, arena_r)
|
||||
for pos: Vector3 in _spread_positions(_spawn_count, bull_angle + PI, arena_r):
|
||||
_spawn_at(pos)
|
||||
|
||||
|
||||
func _spread_positions(count: int) -> Array[Vector3]:
|
||||
func _place_bull(angle: float, arena_r: float) -> void:
|
||||
var bull := get_tree().get_first_node_in_group(&"player") as Node3D
|
||||
if not bull:
|
||||
return
|
||||
bull.global_position = Vector3(
|
||||
cos(angle) * arena_r, bull.global_position.y, sin(angle) * arena_r
|
||||
)
|
||||
|
||||
|
||||
# Positions for the matadors, clustered on the far side (centred on `center_angle`)
|
||||
# so every matador stays near the point diametrically opposite the bull.
|
||||
func _spread_positions(count: int, center_angle: float, arena_r: float) -> Array[Vector3]:
|
||||
var positions: Array[Vector3] = []
|
||||
var arena_r := DP.f("mat_wander_radius") * 0.72
|
||||
var min_r := 5.0
|
||||
if count <= 1:
|
||||
positions.append(Vector3(cos(center_angle) * arena_r, 1.0, sin(center_angle) * arena_r))
|
||||
return positions
|
||||
var arc := TAU * 0.33
|
||||
for i: int in count:
|
||||
var sector := TAU / count
|
||||
var angle := sector * i + randf_range(-sector * 0.35, sector * 0.35)
|
||||
var radius := randf_range(min_r, arena_r)
|
||||
var t := float(i) / float(count - 1) - 0.5 # -0.5 .. 0.5 across the arc
|
||||
var angle := center_angle + t * arc
|
||||
var radius := randf_range(arena_r * 0.7, arena_r)
|
||||
positions.append(Vector3(cos(angle) * radius, 1.0, sin(angle) * radius))
|
||||
return positions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user