gun system + minigun
This commit is contained in:
parent
84415d5aca
commit
f73f093ae2
13 changed files with 84 additions and 24 deletions
|
|
@ -1,16 +1,20 @@
|
|||
class_name Building
|
||||
extends CollisionObject3D
|
||||
|
||||
var health := 10.
|
||||
|
||||
func _ready() -> void:
|
||||
scale.y = randf_range(.5, 1.25)
|
||||
|
||||
func hit(_proj: PlayerProjectile) -> bool:
|
||||
print("boom!")
|
||||
SignalBus.building_destroyed.emit(self)
|
||||
collision_layer = 1 # World collision only
|
||||
func hit(_proj: PlayerProjectile, damage: float) -> bool:
|
||||
health -= damage
|
||||
if health <= 0.:
|
||||
print("boom!")
|
||||
SignalBus.building_destroyed.emit(self)
|
||||
collision_layer = 1 # World collision only
|
||||
|
||||
%Mesh.hide()
|
||||
%DestroyedMesh.show()
|
||||
%GPUParticles3D.preprocess = randf()
|
||||
%Mesh.hide()
|
||||
%DestroyedMesh.show()
|
||||
%GPUParticles3D.preprocess = randf()
|
||||
|
||||
return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue