Added win condition for level 1 and added boss fight for level 5
This commit is contained in:
21
Enemies/Projectiles/Glowing Blue Fireball.gd
Normal file
21
Enemies/Projectiles/Glowing Blue Fireball.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends Area2D
|
||||
|
||||
const SPEED: int = 60
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
|
||||
|
||||
func init(spawn_position: Vector2, shoot_position: Vector2) -> void:
|
||||
position = spawn_position
|
||||
velocity = position.direction_to(shoot_position).normalized() * SPEED
|
||||
return
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position += velocity * delta
|
||||
return
|
||||
|
||||
|
||||
func _on_lifetime_timeout() -> void:
|
||||
call_deferred('queue_free')
|
||||
return
|
Reference in New Issue
Block a user