diff --git a/src/assets/images/backgrounds/bg-1.png b/src/assets/images/backgrounds/bg-1.png new file mode 100644 index 0000000..d039071 Binary files /dev/null and b/src/assets/images/backgrounds/bg-1.png differ diff --git a/src/assets/images/backgrounds/wood-1.jpg b/src/assets/images/backgrounds/wood-1.jpg new file mode 100644 index 0000000..7683987 Binary files /dev/null and b/src/assets/images/backgrounds/wood-1.jpg differ diff --git a/src/common/constants.ts b/src/common/constants.ts new file mode 100644 index 0000000..13fb737 --- /dev/null +++ b/src/common/constants.ts @@ -0,0 +1,7 @@ +export const defaultContainerOptions = { + width: 100, + height: 100, + x: 0, + y: 0, + visible: true +} diff --git a/src/utilities/helpers.ts b/src/common/helpers.ts similarity index 80% rename from src/utilities/helpers.ts rename to src/common/helpers.ts index a98b4b5..d7a98b5 100644 --- a/src/utilities/helpers.ts +++ b/src/common/helpers.ts @@ -1,5 +1,6 @@ import { Graphics, Container } from 'pixi.js' -import type { TileDto } from './interfaces' +import type { ContainerOptions, TileDto } from './interfaces' +import { defaultContainerOptions } from './constants' export function getColorBackground(container: Container, colorName: string, alpha: number = 0.5) { const graphics = new Graphics() @@ -12,24 +13,6 @@ export function getColorBackground(container: Container, colorName: string, alph return graphics } -interface ContainerOptions { - width?: number - height?: number - x?: number - y?: number - color?: number - visible?: boolean - parent?: Container -} - -const defaultContainerOptions = { - width: 100, - height: 100, - x: 0, - y: 0, - visible: true -} - export function createContainer(options: ContainerOptions) { const opts = { ...defaultContainerOptions, ...options } const container = new Container() diff --git a/src/utilities/interfaces.ts b/src/common/interfaces.ts similarity index 85% rename from src/utilities/interfaces.ts rename to src/common/interfaces.ts index 96dde23..e37d371 100644 --- a/src/utilities/interfaces.ts +++ b/src/common/interfaces.ts @@ -1,3 +1,5 @@ +import type { Container } from 'pixi.js' + export interface PlayerDto { id: string name: string @@ -63,3 +65,13 @@ export interface Movement { x?: number y?: number } + +export interface ContainerOptions { + width?: number + height?: number + x?: number + y?: number + color?: number + visible?: boolean + parent?: Container +} diff --git a/src/components/GameComponent.vue b/src/components/GameComponent.vue index 48ecbe4..81ca477 100644 --- a/src/components/GameComponent.vue +++ b/src/components/GameComponent.vue @@ -1,7 +1,7 @@