Equipment menu

This commit is contained in:
gotfishmakesticks 2024-01-13 10:58:44 +03:00
commit bef15301cb
28 changed files with 809 additions and 48 deletions

View file

@ -3,14 +3,20 @@ extends Area2D
@export var menu : PackedScene
@onready var base_collider = $"../BaseCollider/BaseColliderDetector"
var menu_inst
var ship_in_menu = false
func onbcbodyentered(body):
if body is MainShip:
body.engine.speed = 0
func _input(event):
if event is InputEventKey and ship_in_menu:
if Input.is_action_just_released("hide_menu"):
menu_inst.visible = !menu_inst.visible
func _on_body_entered(body):
if body is MainShip:
ship_in_menu = true
body.allow_shooting = false
menu_inst = menu.instantiate()
menu_inst.modulate = get_parent().modulate
@ -26,3 +32,4 @@ func _on_body_exited(body):
body.allow_shooting = true
body.minimap.visible = true
menu_inst.queue_free()
ship_in_menu = false