Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- import BaseState from 'app/utils/base-state';
- import BaseGame from 'app/utils/base-game';
- const initPhaser = (elementId) => {
- const config = [ 800, 800, Phaser.AUTO, elementId ];
- const game = new BaseGame(config, new Map([['boot', BaseState]]));
- return {
- game
- };
- };
- export default Ember.Component.extend({
- init() {
- this._super(...arguments);
- },
- didInsertElement() {
- const { phaser } = initPhaser(this.elementId);
- this.set('phaser', phaser);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement