1
0
forked from noxious/client

worked on wall logics

This commit is contained in:
2024-06-15 03:15:20 +02:00
parent 92103cea9e
commit 4a04bf06cc
10 changed files with 172 additions and 131 deletions

View File

@ -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/
*/