15 lines
261 B
GDScript3
15 lines
261 B
GDScript3
|
extends Area2D
|
||
|
|
||
|
var speed = 750
|
||
|
|
||
|
func setSpeed(speedVal):
|
||
|
speed = speedVal
|
||
|
|
||
|
func _physics_process(delta):
|
||
|
position += transform.x * speed * delta
|
||
|
|
||
|
func _on_body_entered(body):
|
||
|
print("bullet hit something")
|
||
|
if not body.is_in_group("player"):
|
||
|
queue_free()
|