Files
godot-demo-projects/2d/platformer/src/Objects/Bullet.gd
2022-03-27 19:06:05 -05:00

15 lines
215 B
GDScript

class_name Bullet
extends RigidDynamicBody2D
@onready var animation_player = $AnimationPlayer
func destroy():
animation_player.play("destroy")
func _on_body_entered(body):
if body is Enemy:
body.destroy()