sandbox
Last change
on this file since 25e7b67 was f7b09c8, checked in by Kevin Chapman <victory2b@…>, 4 years ago |
First Draft of world test with working movement and loading screen.
|
-
Property mode
set to
100644
|
File size:
857 bytes
|
Line | |
---|
1 | extends Spatial
|
---|
2 |
|
---|
3 | #-----------------SCENE--SCRIPT------------------#
|
---|
4 | # Close your game faster by clicking 'Esc' #
|
---|
5 | # Change mouse mode by clicking 'Shift + F1' #
|
---|
6 | #------------------------------------------------#
|
---|
7 |
|
---|
8 | export var fast_close := true
|
---|
9 |
|
---|
10 |
|
---|
11 | func _ready() -> void:
|
---|
12 | if !OS.is_debug_build():
|
---|
13 | fast_close = false
|
---|
14 |
|
---|
15 | if fast_close:
|
---|
16 | print("** Fast Close enabled in the 'L_Main.gd' script **")
|
---|
17 | print("** 'Esc' to close 'Shift + F1' to release mouse **")
|
---|
18 |
|
---|
19 |
|
---|
20 | func _input(event: InputEvent) -> void:
|
---|
21 | if event.is_action_pressed("ui_cancel") and fast_close:
|
---|
22 | get_tree().quit() # Quits the game
|
---|
23 |
|
---|
24 | if event.is_action_pressed("mouse_input") and fast_close:
|
---|
25 | match Input.get_mouse_mode():
|
---|
26 | Input.MOUSE_MODE_CAPTURED:
|
---|
27 | Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
---|
28 | Input.MOUSE_MODE_VISIBLE:
|
---|
29 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.