change deposit point
This commit is contained in:
@@ -67,10 +67,7 @@ func _on_gathering_target_set(pos: Vector3) -> void:
|
|||||||
if state != AntGathererState.GATHERING:
|
if state != AntGathererState.GATHERING:
|
||||||
return
|
return
|
||||||
|
|
||||||
if pos != Vector3.ZERO:
|
nav_agent.set_target_position(pos)
|
||||||
nav_agent.set_target_position(pos)
|
|
||||||
else:
|
|
||||||
nav_agent.set_target_position(anthill.global_position)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_gathering_stop() -> void:
|
func _on_gathering_stop() -> void:
|
||||||
|
|||||||
@@ -67,10 +67,7 @@ func _on_gathering_target_set(pos: Vector3) -> void:
|
|||||||
if state != AntNitwitState.GATHERING:
|
if state != AntNitwitState.GATHERING:
|
||||||
return
|
return
|
||||||
|
|
||||||
if pos != Vector3.ZERO:
|
nav_agent.set_target_position(pos)
|
||||||
nav_agent.set_target_position(pos)
|
|
||||||
else:
|
|
||||||
nav_agent.set_target_position(anthill.global_position)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_gathering_stop() -> void:
|
func _on_gathering_stop() -> void:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const DEFAULT_MAX_CARRYING = 3
|
|||||||
const DEFAULT_DROP_INTERVAL = 0.25
|
const DEFAULT_DROP_INTERVAL = 0.25
|
||||||
const DEFAULT_PICKUP_INTERVAL = 0.5
|
const DEFAULT_PICKUP_INTERVAL = 0.5
|
||||||
const DROP_SPREAD: float = 0.1
|
const DROP_SPREAD: float = 0.1
|
||||||
|
const ANTHILL_DEPOSIT_RADIUS: float = 0.5
|
||||||
|
|
||||||
enum GatherState {
|
enum GatherState {
|
||||||
PICKING_UP,
|
PICKING_UP,
|
||||||
@@ -65,7 +66,12 @@ func go_gather(item: Honeydew) -> void:
|
|||||||
|
|
||||||
func go_deposit() -> void:
|
func go_deposit() -> void:
|
||||||
state = GatherState.DEPOSITING
|
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:
|
func handle_gathering(stop: bool) -> void:
|
||||||
|
|||||||
Reference in New Issue
Block a user