Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*global require*/
  2. require('./thorny/base')('./config/default.json', './demos/config.processing.json')(function ($) {
  3.     $.es().makeEntity().addComponent('position', {position: {x: 0, y:  0}}).addComponent('drawable', {shape, 'circle'});
  4.     $.es().makeEntity().addComponent('position', {position: {x: 0, y: 10}}).addComponent('drawable', {shape, 'box'});
  5.     $.es().makeEntity().addComponent('position', {position: {x: 0, y: 20}}).addComponent('drawable', {shape, 'triangle'});
  6.     $.es().makeEntity().addComponent('position', {position: {x: 0, y: 30}}).addComponent('drawable', {shape, 'oval'});
  7.    
  8.     // Inside my draw module...
  9.     $.es().searchByComponents('position', 'drawable')
  10.         .each(function (position, drawable) {
  11.             processing[drawable.data.shape](position.data.getX(), position.data.getY(), 10, 10);
  12.         });
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement