mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-08 00:40:08 +01:00
15 lines
215 B
GDScript
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()
|