change deposit point

This commit is contained in:
2024-10-07 05:41:43 +10:00
parent aca7c5902f
commit 76a5645ed3
3 changed files with 9 additions and 9 deletions

View File

@@ -67,10 +67,7 @@ func _on_gathering_target_set(pos: Vector3) -> void:
if state != AntGathererState.GATHERING:
return
if pos != Vector3.ZERO:
nav_agent.set_target_position(pos)
else:
nav_agent.set_target_position(anthill.global_position)
func _on_gathering_stop() -> void:

View File

@@ -67,10 +67,7 @@ func _on_gathering_target_set(pos: Vector3) -> void:
if state != AntNitwitState.GATHERING:
return
if pos != Vector3.ZERO:
nav_agent.set_target_position(pos)
else:
nav_agent.set_target_position(anthill.global_position)
func _on_gathering_stop() -> void:

View File

@@ -8,6 +8,7 @@ const DEFAULT_MAX_CARRYING = 3
const DEFAULT_DROP_INTERVAL = 0.25
const DEFAULT_PICKUP_INTERVAL = 0.5
const DROP_SPREAD: float = 0.1
const ANTHILL_DEPOSIT_RADIUS: float = 0.5
enum GatherState {
PICKING_UP,
@@ -65,7 +66,12 @@ func go_gather(item: Honeydew) -> void:
func go_deposit() -> void:
state = GatherState.DEPOSITING
target_set.emit(Vector3.ZERO)
var dir := anthill.global_position.direction_to(global_position)
target_set.emit(
anthill.global_position
+ dir
* ANTHILL_DEPOSIT_RADIUS
)
func handle_gathering(stop: bool) -> void: