Skip to content

Commit

Permalink
update map cols, rows from config
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnywang committed Apr 17, 2020
1 parent 8b4c11f commit 42f1861
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions logic-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ var loadRoomData = function(room_name){
success: function(ret){
map.version = ret.data.room_data.updated_at;
map.layers = ret.data.room_data.data;
if (map.layers._cols) {
map.cols = parseInt(map.layers._cols);
}
if (map.layers._rows) {
map.rows = parseInt(map.layers._rows);
}
Game.camera.maxX = map.cols * map.tsize - Game.camera.width;
Game.camera.maxY = map.rows * map.tsize - Game.camera.height;
Game.objects = {};
$('#object-list').html('');
ret.data.objects.map(function(o) {
Expand Down

0 comments on commit 42f1861

Please sign in to comment.