[game] Do some amount of snapshot save and restore

This is super jankety and I feel the need for organization but FOR NOW
let's hack away.
This commit is contained in:
John Doty 2023-08-19 18:40:39 -07:00
parent e32643486d
commit 043a3ee183

View file

@ -49,6 +49,20 @@ export function init() {
load_assets();
}
export function suspend() {
return { clock };
}
export function resume(snapshot) {
if (snapshot) {
print("!Resuming!");
const { clock: new_clock } = snapshot;
if (new_clock) {
clock = new_clock;
}
}
}
const friction = 0.6;
let robo_vel = new_v2(0);
let robo_pos = new_v2(10);