small boss progess
This commit is contained in:
parent
986c83ec8f
commit
3f9103b1c8
42 changed files with 769 additions and 54 deletions
18
scripts/boss_spawner.gd
Normal file
18
scripts/boss_spawner.gd
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
extends RigidBody2D
|
||||
|
||||
@export var enemies : Array[Array]
|
||||
@onready var sprite : Sprite2D = $Sprite2D
|
||||
|
||||
func _ready() -> void:
|
||||
var this_enemy = enemies.pick_random()
|
||||
sprite.texture = this_enemy[0]
|
||||
|
||||
angular_velocity = (randf() - 0.5) * 46;
|
||||
linear_velocity.y = -300;
|
||||
linear_velocity.x = (randf() - 0.5) * 300
|
||||
|
||||
await get_tree().create_timer(randf() * 0.2 + 0.6).timeout
|
||||
queue_free()
|
||||
var enemy : Enemy = this_enemy[1].instantiate()
|
||||
enemy.global_position = global_position
|
||||
get_tree().root.add_child(enemy)
|
||||
Loading…
Add table
Add a link
Reference in a new issue