animations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { clamp, lerpAngle, wrapAngle } from './scalar.js';
|
||||
import { clampToRink } from './rink.js';
|
||||
import { normalizePlayer } from './player.js';
|
||||
|
||||
/**
|
||||
* Skating locomotion.
|
||||
@@ -55,6 +56,7 @@ export const SKATE = Object.freeze({
|
||||
});
|
||||
|
||||
export function createSkaterState(id, spawn = {}, opts = {}) {
|
||||
const player = normalizePlayer(opts.player ?? opts);
|
||||
return {
|
||||
id,
|
||||
name: opts.name ?? `Skater ${id}`,
|
||||
@@ -62,6 +64,12 @@ export function createSkaterState(id, spawn = {}, opts = {}) {
|
||||
seed: opts.seed ?? 1337,
|
||||
team: opts.team ?? 0,
|
||||
|
||||
/**
|
||||
* Stable identity traits — shot side, and anything else that picks a pose
|
||||
* set rather than a frame of motion. See `shared/player.js`.
|
||||
*/
|
||||
shotSide: player.shotSide,
|
||||
|
||||
x: spawn.x ?? 0,
|
||||
y: 0,
|
||||
z: spawn.z ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user