diff --git a/src/equipment/mp3_player/mp3_player.gd b/src/equipment/mp3_player/mp3_player.gd index 3bee45f..12dbcc3 100644 --- a/src/equipment/mp3_player/mp3_player.gd +++ b/src/equipment/mp3_player/mp3_player.gd @@ -1,8 +1,12 @@ extends Tool ## Pump up the jamz! +const RUMBLE_INTENSITY = 0.006 +const RUMBLE_DROPOFF = 0.8 + @onready var mp3_controller: MP3Controller = %MP3Controller @onready var audio_stream_player: AudioStreamPlayer = %AudioStreamPlayer +@onready var rumbler: Rumbler3D = %Rumbler func _ready() -> void: @@ -16,13 +20,20 @@ func unlocked() -> bool: func fire() -> void: if not firing: firing = true + rumbler.intensity = RUMBLE_INTENSITY mp3_controller.select() func switch_mode() -> void: + rumbler.intensity = RUMBLE_INTENSITY mp3_controller.cancel() +func _physics_process(delta: float) -> void: + rumbler.intensity *= RUMBLE_DROPOFF + super._physics_process(delta) + + func _on_mp3_collected(_track: MP3Track) -> void: # TODO we may want to dynamically build the player tracklist # rather than rebuilding the whole thing each time a track is collected