cheesy demise

This commit is contained in:
Haze Weathers 2023-10-24 20:10:25 -04:00
parent 7a12628fa3
commit 2ca88e511f
3 changed files with 7 additions and 4 deletions

View file

@ -10,6 +10,7 @@ onready var shootpos = $ShootPos
onready var raycast = $RayCast2D
onready var muzzle_flash = $MuzzleFlashParticles
const ArrowProjectile = preload("res://objects/enemy/roboturret_proj.tscn")
const Death = preload("res://objects/enemy/roboturret_die.tscn")
func _ready():
timer.start(shoot_time)
@ -34,11 +35,13 @@ func spawn_bullet():
arrow.target_group = "player_hitbox"
arrow.speed = arrow_speed
Game.get_map().add_child(arrow)
func die():
.die()
Game.instance_node(load("res://objects/enemy/roboturret_die.tscn"), position.x, position.y, get_parent())
var death = Death.instance()
death.spray_color = Color(0xffbe42ff)
death.global_position = global_position
get_parent().add_child(death)
func _on_Timer_timeout():
if !anims.is_playing(): spawn_bullet()