World.js 405 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
const schema = require('@colyseus/schema');
const Schema = schema.Schema;

class World extends Schema {

  constructor(width, height) {
    super();
    this.width = width;
    this.height = height;
  }

}

schema.defineTypes(GameObject, {
  x: "number",
  y: "number",
  width: "number",
  height: "number",
  velocity: "number",
  direction: "number",
  color: "string"
});

module.exports = GameObject;