add player stats and camera shaking on damage
This commit is contained in:
@@ -43,9 +43,7 @@ func _physics_process(delta: float) -> void:
|
||||
var speed_squash := clampf(
|
||||
_velocity.length() / _speed_stretch_factor, 0, MAX_STRETCH
|
||||
)
|
||||
_model_base.scale = Vector3(
|
||||
1 - speed_squash, 1 - speed_squash, 1 + speed_squash
|
||||
)
|
||||
_model_base.scale = Vector3(1 - speed_squash, 1 - speed_squash, 1 + speed_squash)
|
||||
|
||||
|
||||
func init(velocity: Vector3, start_position: Vector3, lifetime: float = 10) -> void:
|
||||
@@ -62,6 +60,8 @@ func set_velocity(velocity: Vector3) -> void:
|
||||
func _on_body_entered(node: Node3D) -> void:
|
||||
if node is Player:
|
||||
queue_free()
|
||||
var player := node as Player
|
||||
player.stats.damage()
|
||||
return
|
||||
|
||||
if node is CollisionObject3D:
|
||||
|
||||
Reference in New Issue
Block a user