Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*global require*/
- require('./thorny/base')('./config/default.json', './demos/config.processing.json')(function ($) {
- $.es().makeEntity().addComponent('position', {position: {x: 0, y: 0}}).addComponent('drawable', {shape, 'circle'});
- $.es().makeEntity().addComponent('position', {position: {x: 0, y: 10}}).addComponent('drawable', {shape, 'box'});
- $.es().makeEntity().addComponent('position', {position: {x: 0, y: 20}}).addComponent('drawable', {shape, 'triangle'});
- $.es().makeEntity().addComponent('position', {position: {x: 0, y: 30}}).addComponent('drawable', {shape, 'oval'});
- // Inside my draw module...
- $.es().searchByComponents('position', 'drawable')
- .each(function (position, drawable) {
- processing[drawable.data.shape](position.data.getX(), position.data.getY(), 10, 10);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement