Skip to content
Snippets Groups Projects
Commit 1c80683a authored by Trungel's avatar Trungel
Browse files

Bug Fixes

parent 6a5a9945
No related branches found
No related tags found
1 merge request!16Display radius and center
...@@ -48,20 +48,20 @@ export default { ...@@ -48,20 +48,20 @@ export default {
const isViewRadiusBorder = function() { const isViewRadiusBorder = function() {
var borders = []; var borders = [];
//leftBorder //leftBorder
if( props.tile.x == (this.store.state.centerX-this.store.state.radiusX) && if( props.tile.x == (this.store.state.centerX-this.store.state.radiusX+1) &&
((this.store.state.centerY-this.store.state.radiusY) <= props.tile.y && props.tile.y <= (this.store.state.centerY+this.store.state.radiusY))){ ((this.store.state.centerY-this.store.state.radiusY+1) <= props.tile.y && props.tile.y <= (this.store.state.centerY+this.store.state.radiusY-1))){
borders.push("viewBorderLeft"); borders.push("viewBorderLeft");
} }
if( props.tile.x == (this.store.state.centerX+this.store.state.radiusX) && if( props.tile.x == (this.store.state.centerX+this.store.state.radiusX-1) &&
((this.store.state.centerY-this.store.state.radiusY) <= props.tile.y && props.tile.y <= (this.store.state.centerY+this.store.state.radiusY))){ ((this.store.state.centerY-this.store.state.radiusY+1) <= props.tile.y && props.tile.y <= (this.store.state.centerY+this.store.state.radiusY-1))){
borders.push("viewBorderRight") borders.push("viewBorderRight")
} }
if( props.tile.y == (this.store.state.centerY+this.store.state.radiusY) && if( props.tile.y == (this.store.state.centerY+this.store.state.radiusY-1) &&
((this.store.state.centerX-this.store.state.radiusX) <= props.tile.x && props.tile.x <= (this.store.state.centerX+this.store.state.radiusX))){ ((this.store.state.centerX-this.store.state.radiusX+1) <= props.tile.x && props.tile.x <= (this.store.state.centerX+this.store.state.radiusX-1))){
borders.push("viewBorderTop") borders.push("viewBorderTop")
} }
if( props.tile.y == (this.store.state.centerY-this.store.state.radiusY) && if( props.tile.y == (this.store.state.centerY-this.store.state.radiusY+1) &&
((this.store.state.centerX-this.store.state.radiusX) <= props.tile.x && props.tile.x <= (this.store.state.centerX+this.store.state.radiusX))){ ((this.store.state.centerX-this.store.state.radiusX+1) <= props.tile.x && props.tile.x <= (this.store.state.centerX+this.store.state.radiusX-1))){
borders.push("viewBorderBottom") borders.push("viewBorderBottom")
} }
......
...@@ -42,13 +42,10 @@ const methods = { ...@@ -42,13 +42,10 @@ const methods = {
}, },
loadMap(mapData) { loadMap(mapData) {
let tileSetData = this.getMultDimArrayFromFlattendArray(mapData.tileSet);
state.mapID = mapData.mapID; state.mapID = mapData.mapID;
state.mapName = mapData.mapName; state.mapName = mapData.mapName;
state.initialViewRadiusX = mapData.initialViewRadiusX;
state.initialViewRadiusY = mapData.initialViewRadiusY;
state.initialVieCenterX = mapData.initialVieCenterX;
state.initialViewCenterY = mapData.initialViewCenterY;
let tileSetData = this.getMultDimArrayFromFlattendArray(mapData.tileSet);
state.mapSizeX = tileSetData.mapSizeX; state.mapSizeX = tileSetData.mapSizeX;
state.mapSizeY = tileSetData.mapSizeY; state.mapSizeY = tileSetData.mapSizeY;
state.lttMap = tileSetData.map; state.lttMap = tileSetData.map;
...@@ -56,6 +53,10 @@ const methods = { ...@@ -56,6 +53,10 @@ const methods = {
state.minX = tileSetData.minX; state.minX = tileSetData.minX;
state.maxY = tileSetData.maxY; state.maxY = tileSetData.maxY;
state.minY = tileSetData.minY; state.minY = tileSetData.minY;
state.radiusX = mapData.initialViewRadiusX;
state.radiusY = mapData.initialViewRadiusY;
state.centerX = mapData.initialViewCenterX;
state.centerY = mapData.initialViewCenterY;
}, },
getMultDimArrayFromFlattendArray(arr){ getMultDimArrayFromFlattendArray(arr){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment