Added base template (uninteractive yet)

This commit is contained in:
2ndbeam 2024-05-01 12:55:32 +03:00
commit 2d4eb92751
8 changed files with 100 additions and 17 deletions

View file

@ -21,13 +21,18 @@ var faction : Game.Faction = Game.Faction.Player
func _ready() -> void:
hull.global_position = global_position
destroyed.connect(destroy)
destroyed.connect(destroy_timeout)
func destroy_timeout():
get_tree().create_timer(0.02).timeout.connect(destroy)
## Reset all required variables
func destroy() -> void:
hull.hp = hull.max_hp
hull.global_position = spawn_position
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: