This repository has been archived on 2021-04-27. You can view files and clone it, but cannot push or open issues or pull requests.
superv/scenes/s_main/s_main.gd

33 lines
1.0 KiB
GDScript

extends Spatial
#-----------------SCENE--SCRIPT------------------#
# Close your game faster by clicking 'Esc' #
# Change mouse mode by clicking 'Shift + F1' #
#------------------------------------------------#
export var fast_close := true
var mouse_mode: String = "CAPTURED"
##################################################
func _ready() -> void:
print("SuperV Debug Terminal")
print("** This has important info for bug-reporting! **")
print("** If you encounter glitches, copy this and post to **")
print("** https://tildegit.org/minimal64/superv/issues **")
print("** thanks! -minimal64 team ***")
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_cancel") and fast_close:
get_tree().quit() # Quits the game
if event.is_action_pressed("mouse_input") and fast_close:
match mouse_mode: # Switch statement in GDScript
"CAPTURED":
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
mouse_mode = "VISIBLE"
"VISIBLE":
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
mouse_mode = "CAPTURED"