fixed camera controls

This commit is contained in:
Luca 2024-11-17 13:06:55 +01:00
parent cd62e12389
commit d6a0911801
78 changed files with 4044 additions and 81 deletions

View file

@ -1,10 +1,12 @@
class_name SavedGame
extends Resource
# This resource collects all data to save, from the player and other nodes
# This is the main SaveGame that collects all data to save
# It saves all player data and other nodes in the world, quest progress, etc.
# Player info to save
@export var player_money : int = 0
@export var party: Array[MonsterData] = []
@export var monster_storage: Array[MonsterData] = []
# Environment info to save (daytime, current world, weather)
@export var world : String = ""

View file

@ -65,5 +65,8 @@ func load_game() -> void:
if restored_node.has_method("on_load_game"):
restored_node.on_load_game(node)
# This checks if there is a savegame file in the users folder.
# We use FileAccess here to ensure that also works on Android.
# TODO: Research again, why this is needed
func save_exists() -> bool:
return FileAccess.file_exists("user://savegame.tres")

View file

@ -1,7 +1,12 @@
class_name SavedData
extends Resource
# Main class that can save a node's information
# Every node's save data extends from this class
# Class that can save a single node's information
# Every node's save data can either use this SavedData class directly
# or extend from it and add node-specific values
# See "Saving and loading games with Godot" by Godotneers for details:
# https://www.youtube.com/watch?v=43BZsLZheA4&t=2234s
# https://github.com/godotneers/saving-loading-video/blob/main/godotneers-ensuring-saved-game-compatibility.pdf
# Position of the node to save
@export var position: Vector3 = Vector3.ZERO