1
0
Fork 0
1bit-godot-course/metroidvania/Scenes/Player/PlayerMissile.gd

16 lines
432 B
GDScript

extends "res://Scenes/Objects/Proyectile.gd"
const EnemyDeathEffect = preload("res://Scenes/Effects/EnemyDeathEffect.tscn")
const BRICK_LAYER_BIT = 4
func _ready():
pass # Replace with function body.
func _on_Hitbox_body_entered(body):
if body.get_collision_layer_bit(BRICK_LAYER_BIT):
body.queue_free()
Utils.instance_scene_on_main(EnemyDeathEffect, body.global_position + Vector2(8, 8))
._on_Hitbox_body_entered(body)