mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
Properly implement the Hammer item (#599)
* Properly implement the Hammer item * Update Boo.gd * Update LongFirebar.tscn
This commit is contained in:

committed by
GitHub

parent
651988bf5e
commit
8474bc3c19
@@ -14,6 +14,10 @@ func die() -> void:
|
||||
|
||||
func die_from_object(_node: Node2D) -> void:
|
||||
destroy()
|
||||
|
||||
func die_from_hammer(_node: Node2D) -> void:
|
||||
AudioManager.play_sfx("hammer_hit", global_position)
|
||||
destroy()
|
||||
|
||||
func summon_particle() -> void:
|
||||
var node = BARREL_DESTRUCTION_PARTICLE.instantiate()
|
||||
|
@@ -33,7 +33,7 @@ func handle_movement(delta: float) -> void:
|
||||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
if area.owner.is_invincible:
|
||||
if area.owner.is_invincible or area.name == "HammerHitbox":
|
||||
die()
|
||||
else:
|
||||
area.owner.damage()
|
||||
|
@@ -11,7 +11,7 @@ func _physics_process(delta: float) -> void:
|
||||
i.get_node("Sprite").scale.x = sign(get_tree().get_first_node_in_group("Players").global_position.x + 1 - i.global_position.x)
|
||||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
if area.owner is Player and area.name != "HammerHitbox":
|
||||
area.owner.damage()
|
||||
|
||||
func flag_die() -> void:
|
||||
|
@@ -22,7 +22,7 @@ func flag_die() -> void:
|
||||
queue_free()
|
||||
|
||||
func on_area_entered(area: Area2D) -> void:
|
||||
if area.owner is Player:
|
||||
if area.owner is Player and area.name != "HammerHitbox":
|
||||
area.owner.damage()
|
||||
|
||||
func play_sfx() -> void:
|
||||
|
@@ -53,3 +53,8 @@ func flag_die() -> void:
|
||||
func die() -> void:
|
||||
killed.emit()
|
||||
queue_free()
|
||||
|
||||
func die_from_hammer() -> void:
|
||||
AudioManager.play_sfx("hammer_hit", global_position)
|
||||
killed.emit()
|
||||
queue_free()
|
||||
|
Reference in New Issue
Block a user