ajout de panneaux de contrôles, de paramètres et refactorisation de la gestion de l'audio
This commit is contained in:
@@ -57,7 +57,6 @@ func _end_pass_day():
|
||||
func _process(delta):
|
||||
last_action_area_movement_timer += delta
|
||||
if controlling_player:
|
||||
var old_velocity=velocity
|
||||
calculate_direction()
|
||||
|
||||
if (
|
||||
@@ -67,10 +66,6 @@ func _process(delta):
|
||||
instruction.do(self)
|
||||
instruction = null
|
||||
move_preview_zone(get_global_mouse_position())
|
||||
|
||||
# Sound
|
||||
if old_velocity.length()==0 and velocity.length()!=0:
|
||||
play_sfx("move")
|
||||
else:
|
||||
velocity = Vector2.ZERO
|
||||
move_and_slide()
|
||||
@@ -122,7 +117,7 @@ func try_move(move_to : Vector2):
|
||||
instruction = MoveInstruction.new(move_to)
|
||||
|
||||
func pick_item(item : Item) -> Item:
|
||||
play_sfx("pick")
|
||||
AudioManager.play_sfx("PickUp")
|
||||
if data.inventory.is_full():
|
||||
drop_item()
|
||||
|
||||
@@ -143,7 +138,7 @@ func drop_item():
|
||||
var item_to_drop = data.inventory.pop_item()
|
||||
if item_to_drop:
|
||||
terrain.drop_item(item_to_drop, global_position)
|
||||
play_sfx("drop")
|
||||
AudioManager.play_sfx("Drop")
|
||||
|
||||
func delete_item(item: Item):
|
||||
data.inventory.remove_item(item)
|
||||
@@ -231,19 +226,6 @@ func move_preview_zone(zone_position : Vector2):
|
||||
if preview_zone:
|
||||
preview_zone.move_to_position(zone_position)
|
||||
|
||||
func play_sfx(sound : String):
|
||||
match sound:
|
||||
"dig":
|
||||
$Audio/AudioStreamPlayer_dig.play()
|
||||
"harvest":
|
||||
$Audio/AudioStreamPlayer_harvest.play()
|
||||
"pick":
|
||||
$Audio/AudioStreamPlayer_pick_up.play()
|
||||
"drop":
|
||||
$Audio/AudioStreamPlayer_drop.play()
|
||||
"move":
|
||||
$Audio/AudioStreamPlayer_movement.play()
|
||||
|
||||
class Instruction:
|
||||
|
||||
var position : Vector2
|
||||
|
||||
Reference in New Issue
Block a user