Done refactoring

This commit is contained in:
2ndbeam 2023-11-05 21:51:47 +03:00
commit 2176e9d798
88 changed files with 821 additions and 880 deletions

View file

@ -0,0 +1,22 @@
extends Area2D
@export var menu : PackedScene
@onready var base_collider = $"../BaseCollider/BaseColliderDetector"
var menu_inst
func onbcbodyentered(body):
if body is MainShip:
body.engine.speed = 0
func _on_body_entered(body):
if body is MainShip:
body.allow_shooting = false
menu_inst = menu.instantiate()
body.find_child("GUI").add_child(menu_inst)
menu_inst.modulate = get_parent().modulate
func _on_body_exited(body):
if body is MainShip:
body.allow_shooting = true
menu_inst.queue_free()