source: Studio/General/Universal.gd@ 831a978

godot4-dev
Last change on this file since 831a978 was 831a978, checked in by Jonathan Neufeld <support@…>, 3 years ago

Initial commit of Godot4 project Working world and movable player.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1extends Node
2
3# Player related universal vars replaced if config file under player is found.
4var player = "player"
5var health = 1000
6var health_max = 1000
7var stamina = 1000
8var stamina_max = 1000
9var mana = 1000
10var mana_max = 1000
11var lifeforce = 1000
12var lifeforce_max = 1000
13var xp = 0
14var dead = false
15var respaun = false
16# Player inventory universal vars
17var pickup_item
18
19# A variable to hold the mouse sensitivity (so Player.gd can load it)
20var mouse_sensitivity = 8.0
21
22# Task updates hand off
23var food_task = false
24
25# A variable to hold all of the respawn points in a level
26var respawn_points = null
27
28# UI items
29var ui_lock = false # Used to prevent player input while paused and dead.
30
31
32# Config file key bindings
33var keybind_filepath = "res://Player/keybinds.ini"
34var keybind_configfile
35var keybinds = {}
36
37# ------------------------------------
38
39func _ready():
40
41 # Loads in the keybindings
42 keybind_configfile = ConfigFile.new()
43 if keybind_configfile.load(keybind_filepath) == OK:
44 for key in keybind_configfile.get_section_keys("keybinds"):
45 var key_value = keybind_configfile.get_value("keybinds", key)
46 if str(key_value) != "":
47 keybinds[key] = key_value
48 else:
49 keybinds[key] = null
50 else:
51 print("Keybinds Config File Not Found")
52 player = "player"
53 health = 1000
54 stamina = 1000
55 mana = 1000
56 lifeforce = 1000
57 xp = 0
58 if dead == true:
59 dead = false
60 respaun = true
Note: See TracBrowser for help on using the repository browser.