building destruction particles
This commit is contained in:
parent
dba09165e8
commit
afc0aab441
127 changed files with 27285 additions and 240 deletions
|
|
@ -8,6 +8,8 @@ extends CollisionObject3D
|
|||
var shake_duration := 0.
|
||||
@onready var initial_shaker_pos: Vector3 = %Shaker.position
|
||||
|
||||
signal destroyed_from(global_pos: Vector3)
|
||||
|
||||
func _ready() -> void:
|
||||
if randomize_height:
|
||||
scale.y = randf_range(.5, 1.25)
|
||||
|
|
@ -37,11 +39,12 @@ func _show_score_label(score: int) -> void:
|
|||
t.finished.connect(%ScoreLabel.queue_free)
|
||||
|
||||
|
||||
func hit(_proj: Node3D, damage: float) -> bool:
|
||||
func hit(proj: Node3D, damage: float) -> bool:
|
||||
health -= damage
|
||||
if health <= 0.:
|
||||
var score := randi_range(10, 20)
|
||||
SignalBus.building_destroyed.emit(self, score)
|
||||
destroyed_from.emit(proj.global_position)
|
||||
collision_layer = 1 # World collision only
|
||||
|
||||
%Shaker.hide()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue