2024-07-23 01:20:27 +00:00
|
|
|
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")
|
2024-07-29 23:49:17 +00:00
|
|
|
if not body.is_in_group("player"): #if it hits something other than the player, then disappear
|
2024-07-23 01:20:27 +00:00
|
|
|
queue_free()
|