14 lines
249 B
GDScript3
14 lines
249 B
GDScript3
|
extends Area2D
|
||
|
|
||
|
var speed := 700
|
||
|
signal hit(bullet, body)
|
||
|
|
||
|
func setSpeed(speedVal):
|
||
|
speed = speedVal
|
||
|
|
||
|
func _physics_process(delta: float) -> void:
|
||
|
position += transform.x * speed * delta
|
||
|
|
||
|
func _on_body_entered(body: Node2D) -> void:
|
||
|
print("Hit")
|