worked on wall logics
This commit is contained in:
@ -2,13 +2,15 @@ import { defineStore } from 'pinia'
|
||||
|
||||
export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
state: () => ({
|
||||
active: false,
|
||||
active: true,
|
||||
name: '',
|
||||
width: 10,
|
||||
height: 10,
|
||||
tiles: [] as number[][],
|
||||
walls: [] as number[][],
|
||||
decorations: [] as number[][],
|
||||
tool: 'move',
|
||||
drawMode: 'tile',
|
||||
drawMode: 'wall',
|
||||
selectedTile: null,
|
||||
selectedWall: null,
|
||||
selectedDecoration: null,
|
||||
@ -33,6 +35,18 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
updateTile(x: number, y: number, tile: number) {
|
||||
this.tiles[y][x] = tile
|
||||
},
|
||||
setWalls(walls: number[][]) {
|
||||
this.walls = walls
|
||||
},
|
||||
updateWall(x: number, y: number, wall: number) {
|
||||
this.walls[y][x] = wall
|
||||
},
|
||||
setDecorations(decorations: number[][]) {
|
||||
this.decorations = decorations
|
||||
},
|
||||
updateDecoration(x: number, y: number, decoration: number) {
|
||||
this.decorations[y][x] = decoration
|
||||
},
|
||||
setTool(tool: string) {
|
||||
this.tool = tool
|
||||
},
|
||||
@ -57,11 +71,17 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
|
||||
this.height = 10
|
||||
this.tiles = []
|
||||
this.tool = 'move'
|
||||
this.drawMode = 'tile'
|
||||
this.drawMode = 'wall'
|
||||
this.selectedTile = null
|
||||
this.selectedWall = null
|
||||
this.selectedDecoration = null
|
||||
this.isSettingsModalShown = false
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Resources:
|
||||
* https://www.html5gamedevs.com/topic/21908-phaser-is-there-any-tutorial-on-how-to-do-an-isometric-game/
|
||||
* http://murdochcarpenter.com/isometric-starling-part-i/
|
||||
*/
|
Reference in New Issue
Block a user