forked from team-sg/hero-mark-2
cheesy demise
This commit is contained in:
parent
7a12628fa3
commit
2ca88e511f
3 changed files with 7 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue