GazePoint.js 443 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
const schema = require("@colyseus/schema");
const Schema = schema.Schema;

class GazePoint extends Schema {

  constructor(screenX, screenY) {
    this.screenX = screenX;
    this.screenY = screenY;
    this.createdAt = Date.now();
    this.id = this.createdAt;
  }

}

schema.defineTypes(GazePoint, {
    screenX: "number",
    screenY: "number",
    createdAt: "number",
    player: "text",
    id: "number",
});

module.exports = GazePoint;