changes UI to a global singleton

This commit is contained in:
Luca 2024-09-26 19:59:52 +02:00
parent aa4afc4c4b
commit e3aec75404
16 changed files with 371 additions and 119 deletions

View file

@ -28,7 +28,7 @@ func _physics_process(delta: float) -> void:
# Camera rotation
var camera_input_dir := Input.get_vector("joystick_right_left", "joystick_right_right", "joystick_right_left", "joystick_right_right")
$CameraRoot.rotation.y += camera_input_dir.x * 0.2
$CameraRoot.rotation.y += camera_input_dir.x
# Get the input direction and handle the movement / deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
@ -74,3 +74,16 @@ func start_battle(enemy: Node3D, player_position: Vector3) -> void:
await get_tree().create_timer(2.0).timeout
print("timer over")
in_battle = false
func save() -> Dictionary:
var save_dict = {
"player_transform": {
"pos_x": global_position.x,
"pos_y": global_position.y,
"pos_z": global_position.z,
"rot_x": global_rotation.x,
"rot_y": global_rotation.y,
"rot_z": global_rotation.z
}
}
return save_dict