Start of rewind system

This commit is contained in:
Rendo 2025-12-21 02:22:41 +05:00
commit 42c95820d7
16 changed files with 55 additions and 33 deletions

17
systems/rewind.gd Normal file
View file

@ -0,0 +1,17 @@
extends Node
const timestamp_range:float = 200.0 #MSEC
const timestamps_amount: int = 200
var timestamp: float = 0
func _process(delta: float) -> void:
if not is_multiplayer_authority():
return
if Session.session_started_flag:
timestamp += delta
sync_time.rpc(timestamp)
@rpc
func sync_time(new_timestamp: float) -> void:
timestamp = new_timestamp