Made kamikaze behavior and also fixed borders

This commit is contained in:
2ndbeam 2024-05-05 18:20:34 +03:00
commit 1ee0b529a8
10 changed files with 41 additions and 44 deletions

View file

@ -24,7 +24,8 @@ func _ready() -> void:
destroyed.connect(destroy_timeout)
func destroy_timeout():
get_tree().create_timer(0.02).timeout.connect(destroy)
destroy()
get_tree().create_timer(0.05).timeout.connect(hull.warp_to_position.bind(spawn_position))
## Reset all required variables
func destroy() -> void:
@ -32,7 +33,6 @@ func destroy() -> void:
hull.linear_velocity = Vector2.ZERO
hull.angular_velocity = 0.0
shield.capacity = shield.max_capacity
hull.warp_to_position(spawn_position)
## Swaps old hull with the new one
func change_hull(new_hull_id: String) -> void: