Start of rewind system
This commit is contained in:
parent
a293242cb7
commit
42c95820d7
16 changed files with 55 additions and 33 deletions
17
systems/rewind.gd
Normal file
17
systems/rewind.gd
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue