Fixed docking area
This commit is contained in:
parent
739cdbe4c3
commit
1982eb5e4e
1 changed files with 4 additions and 8 deletions
|
|
@ -44,25 +44,24 @@ func on_dock_requested():
|
|||
dock_ready()
|
||||
|
||||
func gate_area_body_entered(body):
|
||||
if body is PlayerShip:
|
||||
if body.ship is PlayerShip:
|
||||
touching_gate = true
|
||||
|
||||
func gate_area_body_exited(body):
|
||||
if body is PlayerShip:
|
||||
if body.ship is PlayerShip:
|
||||
touching_gate = false
|
||||
|
||||
func dock_area_body_entered(body):
|
||||
if body is PlayerShip:
|
||||
if body.ship is PlayerShip:
|
||||
touching_dock = true
|
||||
|
||||
func dock_area_body_exited(body):
|
||||
if body is PlayerShip:
|
||||
if body.ship is PlayerShip:
|
||||
touching_dock = false
|
||||
|
||||
func _process(_delta):
|
||||
if dock_state == DockState.Process:
|
||||
var distance_to_player = global_position.distance_to(player_ship.global_position)
|
||||
print(touching_dock, " ", touching_gate)
|
||||
if touching_dock and !touching_gate:
|
||||
dock_busy()
|
||||
if !touching_dock and !touching_gate and distance_to_player > 2048:
|
||||
|
|
@ -70,7 +69,6 @@ func _process(_delta):
|
|||
|
||||
## Sets dock state to Ready
|
||||
func dock_ready():
|
||||
print("no shit")
|
||||
dock_state = DockState.Ready
|
||||
gate_static.visible = true
|
||||
gate_static.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
|
|
@ -80,7 +78,6 @@ func dock_ready():
|
|||
touching_dock = false
|
||||
## Sets dock state to Process
|
||||
func dock_process():
|
||||
print("wanna dock")
|
||||
dock_state = DockState.Process
|
||||
gate_static.visible = false
|
||||
gate_static.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
|
|
@ -97,5 +94,4 @@ func dock_busy():
|
|||
dock_area.visible = false
|
||||
touching_gate = false
|
||||
touching_dock = true
|
||||
print("busy kozyzy")
|
||||
# TODO: implement opening the base menu
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue