ajout des particules de roche et changement de l'écran de chargement
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
extends Fork
|
||||
class_name Shovel
|
||||
|
||||
const DIG_PARTICLES := preload("res://entities/player/inventory/scripts/items/utils/dig_particles.tscn")
|
||||
const SHOVEL_ZONE_RADIUS = 50
|
||||
|
||||
func get_item_name() -> String:
|
||||
@@ -33,7 +34,7 @@ func can_use(_player : Player, zone : Player.ActionZone) -> bool:
|
||||
return false
|
||||
|
||||
func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
AudioManager.play_sfx("Dig")
|
||||
AudioManager.play_sfx("Rocks")
|
||||
for area in zone.get_affected_areas():
|
||||
if area and area is Plant:
|
||||
harvest(area, player)
|
||||
@@ -45,5 +46,10 @@ func use(player : Player, zone : Player.ActionZone) -> bool:
|
||||
var rock_layer : RockLayer = bodies[rock_layer_id]
|
||||
|
||||
rock_layer.dig_rocks(zone.get_tiles())
|
||||
|
||||
|
||||
var particles := (DIG_PARTICLES.instantiate() as Node2D)
|
||||
player.region.add_child(particles)
|
||||
particles.global_position = zone.get_global_position()
|
||||
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user