FebruaryGame/februarygodotgame/scripts/bullet.gd

18 lines
309 B
GDScript3
Raw Normal View History

2025-03-04 01:40:21 +00:00
class_name Bullet extends Area2D
var speed = 750
signal hit(bullet, body)
func setSpeed(value):
speed = value
#animation
func _physics_process(delta: float) -> void:
position += transform.x * speed * delta
func _on_body_entered(body: Node2D) -> void:
print("bullet collision")
hit.emit(self, body)