2022-11-27 13:31:09 -07:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
onready var global_event_bus = get_node("/root/GlobalEventBus")
|
|
|
|
var sink_counter = 0
|
2022-12-17 11:21:28 -07:00
|
|
|
export var SINK_BLOCK_SLOWDOWN_AMOUNT = Vector3(0.7, 0.1, 0.7)
|
2022-11-27 13:31:09 -07:00
|
|
|
|
|
|
|
func _ready():
|
|
|
|
global_event_bus.connect("player_entered_meat_sink", self, "on_player_enter_meat_sink")
|
|
|
|
global_event_bus.connect("player_exited_meat_sink", self, "on_player_exited_meat_sink")
|
|
|
|
|
|
|
|
func on_player_enter_meat_sink():
|
|
|
|
if sink_counter == 0:
|
|
|
|
$"../OnFootPhysics".increase_velocity_factor(SINK_BLOCK_SLOWDOWN_AMOUNT)
|
|
|
|
sink_counter += 1
|
|
|
|
|
|
|
|
func on_player_exited_meat_sink():
|
|
|
|
sink_counter -= 1
|
|
|
|
if sink_counter == 0:
|
|
|
|
$"../OnFootPhysics".decrease_velocity_factor(SINK_BLOCK_SLOWDOWN_AMOUNT)
|