feat: update
This commit is contained in:
+18
-5
@@ -407,6 +407,15 @@ func spawn_tiles_around(count: int = 4):
|
||||
"""Spawns a mix of normal and special tiles in a radius."""
|
||||
if not enhanced_gridmap: return
|
||||
|
||||
var radius = 2
|
||||
var rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
|
||||
# FIX 1: Make tekton look/rotate toward a random spawning direction
|
||||
if not is_carried and not is_thrown:
|
||||
var random_angle = rng.randf_range(0, TAU)
|
||||
rotation.y = random_angle
|
||||
|
||||
# Play throw animation
|
||||
if not is_carried and not is_thrown:
|
||||
play_animation("tekton_throw_tile")
|
||||
@@ -416,12 +425,11 @@ func spawn_tiles_around(count: int = 4):
|
||||
play_animation("tekton_idle")
|
||||
)
|
||||
|
||||
var radius = 2
|
||||
var rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
|
||||
print("[Tekton] Spawning %d tiles around %s" % [count, current_position])
|
||||
|
||||
# FIX 3: Delay tile spawning to match throw animation timing (feels better)
|
||||
await get_tree().create_timer(0.4).timeout
|
||||
|
||||
var spawned = 0
|
||||
var attempts = 0
|
||||
while spawned < count and attempts < 25:
|
||||
@@ -448,7 +456,12 @@ func spawn_tiles_around(count: int = 4):
|
||||
|
||||
if floor_0_item in [4, -1]:
|
||||
continue
|
||||
|
||||
|
||||
# FIX 2: Check if layer 1 already has tiles (purple powerups or any tile) to prevent blocking
|
||||
var floor_1_item = enhanced_gridmap.get_cell_item(Vector3i(pos.x, 1, pos.y))
|
||||
if floor_1_item != -1:
|
||||
continue # Skip if there's already a tile on layer 1
|
||||
|
||||
# 50% chance to spawn something
|
||||
if rng.randf() > 0.5: continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user