Missiles break bricks
This commit is contained in:
parent
632d927938
commit
2e1bcbc225
5 changed files with 40 additions and 4 deletions
15
metroidvania/Scenes/Player/PlayerMissile.gd
Normal file
15
metroidvania/Scenes/Player/PlayerMissile.gd
Normal file
|
@ -0,0 +1,15 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue