rewired signals and added savemanager and resource saving
This commit is contained in:
parent
0f5045dc22
commit
f694d5c4f8
13 changed files with 138 additions and 87 deletions
|
|
@ -1,12 +1,23 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
@onready var animated_mesh = $GobotSkin
|
||||
|
||||
var in_battle: bool = false
|
||||
|
||||
const SPEED = 5.0
|
||||
const JUMP_VELOCITY = 4.5
|
||||
|
||||
func on_save_game(saved_data : Array[SavedData]):
|
||||
var data = SavedData.new()
|
||||
data.position = global_position
|
||||
data.scene_path = scene_file_path
|
||||
saved_data.append(data)
|
||||
|
||||
func on_before_load_game():
|
||||
get_parent().remove_child(self)
|
||||
queue_free()
|
||||
|
||||
func on_load_game(saved_data: SavedData):
|
||||
global_position = saved_data.position
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if in_battle == true:
|
||||
return
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_xuba7"]
|
||||
height = 1.7
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
[node name="Player" type="CharacterBody3D" groups=["save_nodes"]]
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_y = true
|
||||
axis_lock_angular_z = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue