AhmedFebruary2025/ahmedgg/bullet.gd

18 lines
307 B
GDScript3
Raw Normal View History

2025-03-04 01:41:41 +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)