feat: update
This commit is contained in:
+16
-1
@@ -414,7 +414,16 @@ func spawn_tiles_around(count: int = 4):
|
||||
# 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
|
||||
|
||||
# If it's a static turret, make it face the target tile it's about to spawn instead
|
||||
if is_static_turret:
|
||||
# We don't have a specific target yet, but we can pick an average direction
|
||||
# Or just let it throw randomly like the others. Wait, the user wants:
|
||||
# "static tekton, should facing toward where they're going to thrown the tiles"
|
||||
# We'll calculate rotation inside the spawning loop for static turrets.
|
||||
pass
|
||||
else:
|
||||
rotation.y = random_angle
|
||||
|
||||
# Play throw animation
|
||||
if not is_carried and not is_thrown:
|
||||
@@ -439,6 +448,12 @@ func spawn_tiles_around(count: int = 4):
|
||||
|
||||
var pos = current_position + Vector2i(x, y)
|
||||
|
||||
# For static turret, update rotation to face the exact tile being thrown
|
||||
if is_static_turret and not is_carried and not is_thrown:
|
||||
var throw_dir = Vector3(x, 0, y).normalized()
|
||||
if throw_dir.length_squared() > 0.01:
|
||||
rotation.y = atan2(throw_dir.x, throw_dir.z)
|
||||
|
||||
# Don't overwrite the Tekton's own cell? Or do?
|
||||
# Maybe avoid center.
|
||||
if x == 0 and y == 0: continue
|
||||
|
||||
Reference in New Issue
Block a user