Exemple #1
0
	init(){		
		this.mesh = new c_mesh(this._defaults);
		this.entity.addComponent(this.mesh);
		this.material = new c_material(this._defaults);
		this.entity.addComponent(this.material);
		this.mesh.obj.material = this.material.obj;
	}
Exemple #2
0
	init(){
		this.cursor = new c_cursor(this._defaults);
		this._defaults._cursor = this.cursor.obj;
		this.camVR = new c_cameravr(this._defaults);
		this.camVR.cursorEnt = this.cursor;
		this.fpsUIWindow = this.camVR.fpsUIWindow;
		this.material = new c_material(this._defaults);
		this.cursor.material = this.material;
		this.entity.addComponent(this.material);
		this.entity.addComponent(this.cursor);
		this.entity.addComponent(this.camVR);
	}
Exemple #3
0
	init(){		
		this.multiuser = new c_multiuser(this._defaults);
		this.entity.addComponent(this.multiuser);
		//this.material = new c_material(this._defaults);
		//this.entity.addComponent(this.material);
		//this.mesh.obj.material = this.material.obj;
	}
Exemple #4
0
    generate: function(width, height, seed) {
        //console.log('generate: ', ComponentRegistry);

        if (!_.isUndefined(seed)) {
            this.rng = new RNG(seed);
        }

        var grid = new ComponentRegistry.grid(width, height);
        grid.fill(0);

        var map = new CES.Entity();
        map.addComponent(grid);
        map.addComponent(new ComponentRegistry['mapping/dungeon']());

        this.world.addEntity(map);

        this.initRooms(map);
        this.digRooms(map);
        this.buildCorridors(map);
        this.buildWalls(map);

        return map;
    },
Exemple #5
0
export default function() {
  const level = new Entity()

  const boundsOptions = {
    isStatic: true,
    render: {
      fillStyle: '#222',
      strokeStyle: '#333',
    },
  }

  level.addComponent(new BodiesComponent([

    // upper boundry
    Bodies.rectangle(400, -2390, WIDTH, THICKNESS, boundsOptions),

    // lower boundry
    Bodies.rectangle(400, 610, WIDTH, THICKNESS, boundsOptions),

    // left boundry
    Bodies.rectangle(400 - WIDTH / 2, -890, THICKNESS, HEIGHT, boundsOptions),

    // right boundry
    Bodies.rectangle(400 + WIDTH / 2, -890, THICKNESS, HEIGHT, boundsOptions),

    // veda ground
    Bodies.rectangle(130, 320, 400, 30, boundsOptions),

    // lower blocks
    Bodies.rectangle(600, 200, 100, 100, boundsOptions),
    Bodies.rectangle(700, 300, 100, 100, boundsOptions),

    // outwide ground
    Bodies.rectangle(670, 0, 400, 30, boundsOptions),

    // first divider triple block
    Bodies.rectangle(130, -40, 100, 100, boundsOptions),
    Bodies.rectangle(230, -140, 100, 100, boundsOptions),
    Bodies.rectangle(330, -240, 100, 100, boundsOptions),

    // basetwo ground
    Bodies.rectangle(670, -400, 400, 30, boundsOptions),

    // aot ground
    Bodies.rectangle(420, -700, 700, 30, boundsOptions),
    Bodies.rectangle(400, -900, 15, 400, boundsOptions),

    // intrepid ground
    Bodies.rectangle(420, -900, 700, 30, boundsOptions),

    // apparel 21 ground
    Bodies.rectangle(0, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(100, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(300, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(400, -1300, 200, 50, boundsOptions),
    Bodies.rectangle(500, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(700, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(800, -1300, 50, 50, boundsOptions),
    Bodies.rectangle(900, -1300, 50, 50, boundsOptions),

    // freelance and dragonfly ground
    Bodies.rectangle(300, -1500, 800, 10, boundsOptions),
    Bodies.rectangle(500, -1700, 800, 10, boundsOptions),

    // current ground
    Bodies.rectangle(400, -2100, 400, 20, boundsOptions),

  ]))

  return level
}