JSFiddle - React, Tailwind, and code Playground
by szivak009
JavaScript
/* Let's have some fun with tiles */
/*
* Specification
*
* I'm developing a 2D game and the game is created from 2D graphics. Map will also based on 2D
* graphics, so it means I will implement a 2D tile based multilayer map.
* Objects (tables, desks, houses) are seperated from map generation.
*
* Tiles are multilayered. Bottom layer is for example sand, and the second layer is dust on it.
*
* Tile texture ids:
* 0 - empty
*
*
*
*
*
*
*
*
*/
var map = (function(){
var mapSys = function(){
var tile = function(obj) {
var texId = [];
var x = obj.x === undefined ? 0 : obj.x;
var y = obj.y === undefined ? 0 : obj.y;
var w = obj.w === undefined ? 0 : obj.w;
var h = obj.h === undefined ? 0 : obj.h;
};
var _tiles = [];
this.loadMap = function() {};
this.clear = function() {};
};
return new mapSys();
})();