back end degat vie
This commit is contained in:
parent
c3d84f1e17
commit
7b66e219b2
8 changed files with 138 additions and 14 deletions
19
scenes/enemies/robot_cercle.gd
Normal file
19
scenes/enemies/robot_cercle.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Area2D
|
||||
|
||||
var direction = Vector2.ZERO
|
||||
var timer = 0.0
|
||||
var cooldown = 0.7
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer += delta
|
||||
if timer >= cooldown:
|
||||
queue_free()
|
||||
|
||||
|
||||
func set_direction(direction: Vector2) -> void:
|
||||
self.direction = direction
|
||||
|
||||
|
||||
func Collision(body: Node2D) -> void:
|
||||
if body.is_in_group("Player"):
|
||||
body.take_damage(3)
|
Loading…
Add table
Add a link
Reference in a new issue