Files
GodotCourse/examples/PlatformTemplate/scenes/bullet.gd
T

21 lines
366 B
GDScript
Raw Normal View History

2024-07-15 08:00:42 -04:00
extends Area2D
var speed = 750
func setSpeed(speedVal):
speed = speedVal
func _physics_process(delta):
position += transform.x * speed * delta
func _on_Bullet_body_entered(body):
if body.is_in_group("mobs"):
body.queue_free()
queue_free()
func _on_body_entered(body):
# blast the body?
if body.is_in_group("boxes"):
body.queue_free()
queue_free()