knockback; base enemy scene; police van
This commit is contained in:
parent
370eb54163
commit
d0bfe8d1be
13 changed files with 218 additions and 111 deletions
|
|
@ -2,9 +2,8 @@ extends Area3D
|
|||
|
||||
func _on_collision(node: Node3D):
|
||||
if node.has_method("hit"):
|
||||
node.hit(null, INF)
|
||||
node.hit(self, INF)
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_on_collision)
|
||||
area_entered.connect(_on_collision)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ func fire(aim_angle: float) -> void:
|
|||
player_projectile.damage = 4
|
||||
player_projectile.can_hit_weak_points = false
|
||||
player_projectile.global_position = global_position + Vector3.UP * 0.5
|
||||
player_projectile.knockback_mul = 0.25
|
||||
get_tree().current_scene.add_child(player_projectile)
|
||||
fire_clock = 60. / fire_rate
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ var health: int = 1:
|
|||
queue_free()
|
||||
var damage := 10.
|
||||
var can_hit_weak_points := true
|
||||
var knockback_mul := 1.
|
||||
|
||||
func _on_collision(node: Node3D):
|
||||
if node.has_method("hit"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue