JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.4/phaser.min.js"></script>
<script src="dist/all.js"></script>
</body>
JavaScript
'use strict';
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var Map = (function () {
function Map() {
_classCallCheck(this, Map);
}
_createClass(Map, null, [{
key: 'init',
value: function init(info, w, h) {
this.info = info;
this.WIDTH = w;
this.HEIGHT = h;
}
}, {
key: 'fillArray',
value: function fillArray() {
var fullArr = [];
for (var y = 0; y < this.HEIGHT; y++) {
var tempArr = [];
for (var x = 0; x < this.WIDTH; x++) {
tempArr.push(Math.round(Math.random() * 1));
}
fullArr.push(tempArr);
}
return fullArr;
}
}, {
key: 'fillKeys',
value: function fillKeys() {
var fullArr = {};
for (var y = 0; y < this.HEIGHT; y++) {
for (var x = 0; x < this.WIDTH; x++) {
fullArr[x + ',' + y] = Math.round(Math.random() * 1);
}
}
return fullArr;
}
}, {
key: 'createTileMap',
value: function createTileMap() {
this.drawInfo = game.add.tilemap();
var bmd = game.make.bitmapData(32, 32);
...