Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import Ember from 'ember';
  2. import BaseState from 'app/utils/base-state';
  3. import BaseGame from 'app/utils/base-game';
  4.  
  5. const initPhaser = (elementId) => {
  6. const config = [ 800, 800, Phaser.AUTO, elementId ];
  7. const game = new BaseGame(config, new Map([['boot', BaseState]]));
  8.  
  9. return {
  10. game
  11. };
  12. };
  13.  
  14. export default Ember.Component.extend({
  15. init() {
  16. this._super(...arguments);
  17. },
  18.  
  19. didInsertElement() {
  20. const { phaser } = initPhaser(this.elementId);
  21. this.set('phaser', phaser);
  22. }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement