+
{{ route.meta.title }}
diff --git a/apps/telegram-game/src/router/index.ts b/apps/telegram-game/src/router/index.ts
index 388c54f..c55e928 100644
--- a/apps/telegram-game/src/router/index.ts
+++ b/apps/telegram-game/src/router/index.ts
@@ -1,5 +1,6 @@
import GameView from '@/views/GameView.vue'
import InventoryView from '@/views/InventoryView.vue'
+import QuestView from '@/views/QuestView.vue'
import ShopView from '@/views/ShopView.vue'
import { createRouter, createWebHistory } from 'vue-router'
import LucideArchiveRestore from '~icons/lucide/archive-restore'
@@ -30,7 +31,7 @@ export const routes = [
{
path: '/quest',
name: 'quest',
- component: InventoryView,
+ component: QuestView,
icon: LucideBookCheck,
meta: {
title: 'Задания',
diff --git a/apps/telegram-game/src/utils/gameClient.ts b/apps/telegram-game/src/utils/gameClient.ts
new file mode 100644
index 0000000..a926422
--- /dev/null
+++ b/apps/telegram-game/src/utils/gameClient.ts
@@ -0,0 +1,7 @@
+import { BaseGameAddon } from '@chat-game/game'
+
+const gameClient = new BaseGameAddon({ websocketUrl: getEnv('VITE_WEBSOCKET_URL'), client: 'TELEGRAM_CLIENT' })
+
+const roomConnected = ref()
+
+export { gameClient, roomConnected }
diff --git a/apps/telegram-game/src/views/InventoryView.vue b/apps/telegram-game/src/views/InventoryView.vue
index b2204af..9661741 100644
--- a/apps/telegram-game/src/views/InventoryView.vue
+++ b/apps/telegram-game/src/views/InventoryView.vue
@@ -14,7 +14,7 @@
diff --git a/apps/telegram-game/src/views/QuestView.vue b/apps/telegram-game/src/views/QuestView.vue
new file mode 100644
index 0000000..a206c0d
--- /dev/null
+++ b/apps/telegram-game/src/views/QuestView.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+ {{ room.name }}
+
+
+ {{ room.description }}
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/telegram-game/src/views/ShopView.vue b/apps/telegram-game/src/views/ShopView.vue
index 9845128..d524cb2 100644
--- a/apps/telegram-game/src/views/ShopView.vue
+++ b/apps/telegram-game/src/views/ShopView.vue
@@ -1,27 +1,9 @@
-
-
-
-
- {{ data?.username }}
-
-
- {{ data?.id }}
-
-
-
-
-
+
diff --git a/apps/website/app/pages/(games)/wagon/index.vue b/apps/website/app/pages/(games)/wagon/index.vue
index df7d054..db8e142 100644
--- a/apps/website/app/pages/(games)/wagon/index.vue
+++ b/apps/website/app/pages/(games)/wagon/index.vue
@@ -33,11 +33,12 @@ onMounted(async () => {
width: 100vw;
height: 100vh;
overflow: hidden;
+ position: relative;
}
#game-canvas {
width: 100%;
- height: 250px;
+ height: 350px;
bottom: -100px;
position: absolute;
overflow: hidden;
diff --git a/packages/game/package.json b/packages/game/package.json
index eef8bf6..ab223a3 100644
--- a/packages/game/package.json
+++ b/packages/game/package.json
@@ -14,6 +14,7 @@
"dependencies": {
"@chat-game/types": "workspace:*",
"@paralleldrive/cuid2": "^2.2.2",
+ "@vueuse/core": "^12.0.0",
"pixi.js": "^8.6.1"
},
"devDependencies": {
diff --git a/packages/game/src/lib/assets.d.ts b/packages/game/src/lib/assets.d.ts
new file mode 100644
index 0000000..f93a508
--- /dev/null
+++ b/packages/game/src/lib/assets.d.ts
@@ -0,0 +1,4 @@
+declare module '*.png' {
+ const value: string
+ export default value
+}
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/blue.png b/packages/game/src/lib/assets/images/objects/tree/1/blue.png
new file mode 100644
index 0000000..c2b2457
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/blue.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/green.png b/packages/game/src/lib/assets/images/objects/tree/1/green.png
new file mode 100644
index 0000000..c4b2958
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/green.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/stone.png b/packages/game/src/lib/assets/images/objects/tree/1/stone.png
new file mode 100644
index 0000000..b154a4b
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/stone.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/teal.png b/packages/game/src/lib/assets/images/objects/tree/1/teal.png
new file mode 100644
index 0000000..4f2b05a
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/teal.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/toxic.png b/packages/game/src/lib/assets/images/objects/tree/1/toxic.png
new file mode 100644
index 0000000..256bf42
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/toxic.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/1/violet.png b/packages/game/src/lib/assets/images/objects/tree/1/violet.png
new file mode 100644
index 0000000..ed7dc9d
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/1/violet.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/blue.png b/packages/game/src/lib/assets/images/objects/tree/2/blue.png
new file mode 100644
index 0000000..33f59b0
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/blue.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/green.png b/packages/game/src/lib/assets/images/objects/tree/2/green.png
new file mode 100644
index 0000000..ddb6a16
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/green.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/stone.png b/packages/game/src/lib/assets/images/objects/tree/2/stone.png
new file mode 100644
index 0000000..1310806
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/stone.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/teal.png b/packages/game/src/lib/assets/images/objects/tree/2/teal.png
new file mode 100644
index 0000000..2b2fe0f
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/teal.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/toxic.png b/packages/game/src/lib/assets/images/objects/tree/2/toxic.png
new file mode 100644
index 0000000..f126962
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/toxic.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/2/violet.png b/packages/game/src/lib/assets/images/objects/tree/2/violet.png
new file mode 100644
index 0000000..6abf285
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/2/violet.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/3/blue.png b/packages/game/src/lib/assets/images/objects/tree/3/blue.png
new file mode 100644
index 0000000..071e9a1
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/3/blue.png differ
diff --git a/apps/telegram-game/public/objects/tree/green.png b/packages/game/src/lib/assets/images/objects/tree/3/green.png
similarity index 100%
rename from apps/telegram-game/public/objects/tree/green.png
rename to packages/game/src/lib/assets/images/objects/tree/3/green.png
diff --git a/packages/game/src/lib/assets/images/objects/tree/3/stone.png b/packages/game/src/lib/assets/images/objects/tree/3/stone.png
new file mode 100644
index 0000000..387bf22
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/3/stone.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/3/teal.png b/packages/game/src/lib/assets/images/objects/tree/3/teal.png
new file mode 100644
index 0000000..ff426c5
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/3/teal.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/3/toxic.png b/packages/game/src/lib/assets/images/objects/tree/3/toxic.png
new file mode 100644
index 0000000..c408f5c
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/3/toxic.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/3/violet.png b/packages/game/src/lib/assets/images/objects/tree/3/violet.png
new file mode 100644
index 0000000..baa1adc
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/3/violet.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/blue.png b/packages/game/src/lib/assets/images/objects/tree/4/blue.png
new file mode 100644
index 0000000..d1a6485
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/blue.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/green.png b/packages/game/src/lib/assets/images/objects/tree/4/green.png
new file mode 100644
index 0000000..b2729d4
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/green.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/stone.png b/packages/game/src/lib/assets/images/objects/tree/4/stone.png
new file mode 100644
index 0000000..93f2737
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/stone.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/teal.png b/packages/game/src/lib/assets/images/objects/tree/4/teal.png
new file mode 100644
index 0000000..942d8a8
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/teal.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/toxic.png b/packages/game/src/lib/assets/images/objects/tree/4/toxic.png
new file mode 100644
index 0000000..aebc323
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/toxic.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/4/violet.png b/packages/game/src/lib/assets/images/objects/tree/4/violet.png
new file mode 100644
index 0000000..2323eb4
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/4/violet.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/blue.png b/packages/game/src/lib/assets/images/objects/tree/5/blue.png
new file mode 100644
index 0000000..a7f9b49
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/blue.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/green.png b/packages/game/src/lib/assets/images/objects/tree/5/green.png
new file mode 100644
index 0000000..6103efd
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/green.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/stone.png b/packages/game/src/lib/assets/images/objects/tree/5/stone.png
new file mode 100644
index 0000000..6892856
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/stone.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/teal.png b/packages/game/src/lib/assets/images/objects/tree/5/teal.png
new file mode 100644
index 0000000..f42ec6b
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/teal.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/toxic.png b/packages/game/src/lib/assets/images/objects/tree/5/toxic.png
new file mode 100644
index 0000000..7695da7
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/toxic.png differ
diff --git a/packages/game/src/lib/assets/images/objects/tree/5/violet.png b/packages/game/src/lib/assets/images/objects/tree/5/violet.png
new file mode 100644
index 0000000..71d85a3
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/tree/5/violet.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/chest-1.png b/packages/game/src/lib/assets/images/objects/wagon/chest-1.png
new file mode 100644
index 0000000..df644b9
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/chest-1.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/clouds/1.png b/packages/game/src/lib/assets/images/objects/wagon/clouds/1.png
new file mode 100644
index 0000000..c42cd97
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/clouds/1.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/clouds/2.png b/packages/game/src/lib/assets/images/objects/wagon/clouds/2.png
new file mode 100644
index 0000000..e19d36a
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/clouds/2.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/clouds/3.png b/packages/game/src/lib/assets/images/objects/wagon/clouds/3.png
new file mode 100644
index 0000000..bc13e61
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/clouds/3.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/clouds/4.png b/packages/game/src/lib/assets/images/objects/wagon/clouds/4.png
new file mode 100644
index 0000000..25ad028
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/clouds/4.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/engine-1.png b/packages/game/src/lib/assets/images/objects/wagon/engine-1.png
new file mode 100644
index 0000000..27a0b79
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/engine-1.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/wagon-1.png b/packages/game/src/lib/assets/images/objects/wagon/wagon-1.png
new file mode 100644
index 0000000..c59632c
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/wagon-1.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/wagon-2.png b/packages/game/src/lib/assets/images/objects/wagon/wagon-2.png
new file mode 100644
index 0000000..7b3c683
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/wagon-2.png differ
diff --git a/packages/game/src/lib/assets/images/objects/wagon/wheel-1.png b/packages/game/src/lib/assets/images/objects/wagon/wheel-1.png
new file mode 100644
index 0000000..a57a049
Binary files /dev/null and b/packages/game/src/lib/assets/images/objects/wagon/wheel-1.png differ
diff --git a/packages/game/src/lib/baseGameAddon.ts b/packages/game/src/lib/baseGameAddon.ts
index 8593d03..78cfc82 100644
--- a/packages/game/src/lib/baseGameAddon.ts
+++ b/packages/game/src/lib/baseGameAddon.ts
@@ -3,6 +3,7 @@ import type {
GameAddon,
GameObject,
GameObjectPlayer,
+ GameObjectWagon,
PlayerService,
ServerService,
TreeService,
@@ -10,9 +11,11 @@ import type {
} from './types'
import { createId } from '@paralleldrive/cuid2'
import { Application, Container, Rectangle, TextureStyle } from 'pixi.js'
+import { BaseWagonObject } from './objects/baseWagonObject'
import { FlagObject } from './objects/flagObject'
import { PlayerObject } from './objects/unit/playerObject'
import { MoveToFlagScript } from './scripts/moveToFlagScript'
+import { BaseAssetService } from './services/baseAssetService'
import { BasePlayerService } from './services/basePlayerService'
import { BaseServerService } from './services/baseServerService'
import { BaseTreeService } from './services/baseTreeService'
@@ -31,6 +34,7 @@ export class BaseGameAddon extends Container implements GameAddon {
app: Application
tick: GameAddon['tick'] = 0
+ assetService: BaseAssetService
playerService: PlayerService
treeService: TreeService
websocketService: WebSocketService
@@ -41,6 +45,7 @@ export class BaseGameAddon extends Container implements GameAddon {
bottomY = 0
leftX = 0
+ cameraTarget: GameObjectWagon | GameObjectPlayer | null = null
cameraOffsetX = 0
cameraMovementSpeedX = 0.008
cameraOffsetY = 0
@@ -57,6 +62,7 @@ export class BaseGameAddon extends Container implements GameAddon {
this.client = client
this.app = new Application()
+ this.assetService = new BaseAssetService(this as GameAddon)
this.playerService = new BasePlayerService(this as GameAddon)
this.treeService = new BaseTreeService(this as GameAddon)
this.websocketService = new BaseWebSocketService(this as GameAddon, websocketUrl)
@@ -72,6 +78,8 @@ export class BaseGameAddon extends Container implements GameAddon {
resizeTo: window,
})
+ await this.assetService.load()
+
TextureStyle.defaultOptions.scaleMode = 'nearest'
this.app.ticker.maxFPS = 60
this.bottomY = this.app.screen.height - 100
@@ -87,9 +95,20 @@ export class BaseGameAddon extends Container implements GameAddon {
this.app.stage.addChild(this)
- const nick = new PlayerObject({ id: 'svhjz9p5467wne9ybasf1bwy', addon: this, x: 0, y: this.bottomY })
+ const nick = new PlayerObject({ id: 'svhjz9p5467wne9ybasf1bwy', addon: this, x: 500, y: this.bottomY })
await nick.init()
+ const wagon = new BaseWagonObject({ addon: this, x: 300, y: this.bottomY })
+ this.app.stage.addChild(wagon)
+ this.addChild(wagon)
+
+ if (this.client === 'TELEGRAM_CLIENT') {
+ this.cameraTarget = nick
+ }
+ if (this.client === 'WAGON_CLIENT') {
+ this.cameraTarget = wagon
+ }
+
this.app.stage.addEventListener('pointerdown', (e) => {
const middle = this.app.screen.width / 2
const offsetX = e.clientX - middle
@@ -115,8 +134,7 @@ export class BaseGameAddon extends Container implements GameAddon {
this.#updateObjects()
this.#removeDestroyedObjects()
- const target = nick
- this.#changeCameraPosition(target.x)
+ this.#changeCameraPosition(this.cameraTarget ? this.cameraTarget.x : 0)
this.#moveCamera()
rectangle.x = nick.x - this.app.screen.width / 2
})
@@ -233,18 +251,6 @@ export class BaseGameAddon extends Container implements GameAddon {
target: object.target,
})
}
-
- if (object.state === 'IDLE') {
- // const random = getRandomInRange(1, 250)
- // if (random <= 1) {
- // const target = this.randomNearFlag
-
- // object.script = new MoveToTargetScript({
- // object,
- // target,
- // })
- // }
- }
}
#removeDestroyedObjects() {
@@ -260,19 +266,9 @@ export class BaseGameAddon extends Container implements GameAddon {
#changeCameraPosition(x: number) {
const columnWidth = this.app.screen.width / 6
- const leftPadding = columnWidth * 3
-
- // if (wagon.speedPerSecond === 0) {
- // leftPadding = columnWidth * 3
-
- // if (wagon.state === 'IDLE' && !wagon.cargoType) {
- // // At Village stop
- // leftPadding = columnWidth
- // topPadding = rowHeight * 4
- // }
- // }
+ const leftPadding = this.client === 'TELEGRAM_CLIENT' ? 3 : 1
- this.cameraPerfectX = -x + leftPadding
+ this.cameraPerfectX = -x + columnWidth * leftPadding
// If first load
if (Math.abs(-x - this.cameraX) > 300) {
@@ -290,25 +286,6 @@ export class BaseGameAddon extends Container implements GameAddon {
this.cameraX += addToX * moduleX
}
- // const bufferY = Math.abs(this.cameraPerfectY - this.cameraY)
- // const moduleY = this.cameraPerfectY - this.cameraY > 0 ? 1 : -1
- // const addToY = bufferY > cameraMaxSpeed ? cameraMaxSpeed : bufferY
-
- // if (this.cameraY !== this.cameraPerfectY) {
- // this.cameraY += addToY * moduleY
- // }
-
- // if (Math.abs(this.cameraOffsetX) >= 20) {
- // this.cameraMovementSpeedX *= -1
- // }
- // this.cameraOffsetX += this.cameraMovementSpeedX
- //
- // if (Math.abs(this.cameraOffsetY) >= 30) {
- // this.cameraMovementSpeedY *= -1
- // }
- // this.cameraOffsetY += this.cameraMovementSpeedY
-
this.parent.x = this.cameraX
- // this.parent.y = this.cameraY
}
}
diff --git a/packages/game/src/lib/objects/baseWagonObject.ts b/packages/game/src/lib/objects/baseWagonObject.ts
new file mode 100644
index 0000000..f55f115
--- /dev/null
+++ b/packages/game/src/lib/objects/baseWagonObject.ts
@@ -0,0 +1,169 @@
+import type { Sprite } from 'pixi.js'
+import type { GameAddon, GameObjectWagon } from '../types'
+import { Container } from 'pixi.js'
+import { MoveToFlagScript } from '../scripts/moveToFlagScript'
+import { getRandomInRange } from '../utils/random'
+import { BaseObject } from './baseObject'
+import { FlagObject } from './flagObject'
+
+interface BaseWagonObjectOptions {
+ addon: GameAddon
+ x: number
+ y: number
+}
+
+export class BaseWagonObject extends BaseObject implements GameObjectWagon {
+ #bottomOffset = 30
+ #wheel1!: Sprite
+ #wheel2!: Sprite
+ #engineClouds!: Container
+ #engineCloudsOffset = 0
+
+ constructor({ addon, x, y }: BaseWagonObjectOptions) {
+ super({ addon, x, y, type: 'WAGON' })
+
+ this.state = 'IDLE'
+ this.speedPerSecond = 20
+ this.minDistance = 35
+
+ this.#initVisual()
+ this.setNearestTarget()
+ }
+
+ override live() {
+ super.live()
+
+ if (this.script) {
+ return this.script.live()
+ }
+
+ if (this.state === 'IDLE') {
+ this.setNearestTarget()
+ }
+ }
+
+ override animate() {
+ super.animate()
+
+ this.zIndex = -5
+ this.y = this.addon.bottomY - this.#bottomOffset
+
+ this.#drawWheels()
+ this.#drawEngineClouds(this.speedPerSecond)
+ }
+
+ setNearestTarget() {
+ this.target = new FlagObject({ addon: this.addon, x: this.x + 200, y: this.y, variant: 'MOVEMENT' })
+ this.script = new MoveToFlagScript({
+ object: this,
+ target: this.target,
+ })
+ }
+
+ #initVisual() {
+ const spriteSide = this.addon.assetService.sprite('WAGON_BASE_1')
+ spriteSide.anchor.set(0.5, 1)
+ spriteSide.scale = 0.75
+
+ // const spriteBase = this.addon.assetService.sprite('WAGON_BASE_2')
+ // spriteBase.anchor.set(0.5, 1)
+ // spriteBase.scale = 0.75
+
+ const engine = this.addon.assetService.sprite('WAGON_ENGINE')
+ engine.anchor.set(0.5, 1)
+ engine.scale = 0.75
+ engine.x = -50
+ engine.y = -36
+ engine.visible = true
+
+ this.#engineClouds = new Container()
+ this.#engineClouds.x = -60
+ this.#engineClouds.y = -100
+
+ this.#wheel1 = this.addon.assetService.sprite('WAGON_WHEEL')
+ this.#wheel1.anchor.set(0.5, 0.5)
+
+ this.#wheel2 = this.addon.assetService.sprite('WAGON_WHEEL')
+ this.#wheel2.anchor.set(0.5, 0.5)
+
+ this.#wheel1.scale = 0.75
+ this.#wheel2.scale = 0.75
+
+ this.addChild(
+ // spriteBase,
+ engine,
+ spriteSide,
+ this.#wheel1,
+ this.#wheel2,
+ this.#engineClouds,
+ )
+ }
+
+ #drawWheels() {
+ const speed = this.state !== 'MOVING' ? 0 : this.speedPerSecond
+ const wheelRotation = this.direction === 'LEFT' ? -1 : 1
+
+ // Wheel 1
+ this.#wheel1.visible = true
+ this.#wheel1.x = -123
+ this.#wheel1.y = -16
+
+ // Wheel 2
+ this.#wheel2.visible = true
+ this.#wheel2.x = 123
+ this.#wheel2.y = -16
+
+ if (speed > 0) {
+ this.#wheel1.angle += (wheelRotation * speed) / 55
+ this.#wheel2.angle += (wheelRotation * speed) / 55
+ }
+ }
+
+ #drawEngineClouds(speed: number) {
+ this.#engineCloudsOffset -= speed / this.addon.tick + 15
+
+ const cloudsActive = speed / this.addon.tick + 3
+ const canCreateCloud
+ = this.#engineClouds.children.length < cloudsActive && this.#engineCloudsOffset <= 0
+ if (canCreateCloud) {
+ this.#createRandomEngineCloud()
+ this.#engineCloudsOffset = speed * getRandomInRange(30, 70) + 3
+ }
+
+ for (const container of this.#engineClouds.children) {
+ container.visible = true
+
+ container.x -= speed / this.addon.tick + 0.02
+ container.y -= 0.12
+ container.scale = 0.75
+ container.alpha -= 0.005
+
+ if (container.alpha <= 0) {
+ this.#engineClouds.removeChild(container)
+ }
+ }
+ }
+
+ #getRandomEngineCloudSpriteIndex() {
+ const random = getRandomInRange(1, 1000)
+ if (random <= 500) {
+ return 'WAGON_ENGINE_CLOUD_1'
+ }
+ if (random <= 750) {
+ return 'WAGON_ENGINE_CLOUD_2'
+ }
+ if (random <= 995) {
+ return 'WAGON_ENGINE_CLOUD_3'
+ }
+ return 'WAGON_ENGINE_CLOUD_4'
+ }
+
+ #createRandomEngineCloud() {
+ const sprite = this.addon.assetService.sprite(this.#getRandomEngineCloudSpriteIndex())
+ sprite.anchor.set(0.5, 1)
+ sprite.scale = 0.75
+ sprite.visible = false
+
+ this.#engineClouds.addChild(sprite)
+ }
+}
diff --git a/packages/game/src/lib/objects/treeObject.ts b/packages/game/src/lib/objects/treeObject.ts
index 7ddb37f..8e66f4e 100644
--- a/packages/game/src/lib/objects/treeObject.ts
+++ b/packages/game/src/lib/objects/treeObject.ts
@@ -1,5 +1,4 @@
import type { GameAddon, GameObjectTree } from '../types'
-import { Assets, Sprite } from 'pixi.js'
import { getRandomInRange } from '../utils/random'
import { BaseObject } from './baseObject'
@@ -12,11 +11,12 @@ interface TreeObjectOptions {
export class TreeObject extends BaseObject implements GameObjectTree {
variant: GameObjectTree['variant']
+ treeType: GameObjectTree['treeType']
isReadyToChop!: boolean
#minSizeToChop = 75
- #maxSize = 125
- #growSpeedPerSecond = 3
+ #maxSize = 155
+ #growSpeedPerSecond = getRandomInRange(2, 4)
#animationAngle = getRandomInRange(-1, 1)
#animationSlowSpeed = 0.04
#animationHighSpeed = 0.5
@@ -29,15 +29,16 @@ export class TreeObject extends BaseObject implements GameObjectTree {
this.health = 100
this.variant = 'GREEN'
+ this.treeType = this.#getNewType()
- this.zIndex = getRandomInRange(-1, 1)
+ this.zIndex = getRandomInRange(-10, 1)
- this.initVisual()
+ this.#initVisual()
}
- async initVisual(): Promise {
- const texture = await Assets.load(`/objects/tree/green.png`)
- const sprite = Sprite.from(texture)
+ #initVisual() {
+ const alias = this.#getSpriteByType()
+ const sprite = this.addon.assetService.sprite(alias)
sprite.anchor.set(0.5, 1)
sprite.eventMode = 'static'
sprite.cursor = 'pointer'
@@ -146,24 +147,31 @@ export class TreeObject extends BaseObject implements GameObjectTree {
}
}
- // #getSpriteByType() {
- // if (this.variant === 'GREEN') {
- // return Sprite.from(`tree${this.type}Green`)
- // }
- // if (this.variant === 'BLUE') {
- // return Sprite.from(`tree${this.type}Blue`)
- // }
- // if (this.variant === 'STONE') {
- // return Sprite.from(`tree${this.type}Stone`)
- // }
- // if (this.variant === 'TEAL') {
- // return Sprite.from(`tree${this.type}Teal`)
- // }
- // if (this.variant === 'TOXIC') {
- // return Sprite.from(`tree${this.type}Toxic`)
- // }
- // if (this.variant === 'VIOLET') {
- // return Sprite.from(`tree${this.type}Violet`)
- // }
- // }
+ #getNewType(): GameObjectTree['treeType'] {
+ const items = ['1', '2', '3', '4', '5'] as const
+ return items[Math.floor(Math.random() * items.length)] as GameObjectTree['treeType']
+ }
+
+ #getSpriteByType() {
+ if (this.variant === 'GREEN') {
+ return `TREE_${this.treeType}_GREEN`
+ }
+ if (this.variant === 'BLUE') {
+ return `TREE_${this.treeType}_BLUE`
+ }
+ if (this.variant === 'STONE') {
+ return `TREE_${this.treeType}_STONE`
+ }
+ if (this.variant === 'TEAL') {
+ return `TREE_${this.treeType}_TEAL`
+ }
+ if (this.variant === 'TOXIC') {
+ return `TREE_${this.treeType}_TOXIC`
+ }
+ if (this.variant === 'VIOLET') {
+ return `TREE_${this.treeType}_VIOLET`
+ }
+
+ return `TREE_${this.treeType}_GREEN`
+ }
}
diff --git a/packages/game/src/lib/objects/unit/playerObject.ts b/packages/game/src/lib/objects/unit/playerObject.ts
index 960220b..30fd610 100644
--- a/packages/game/src/lib/objects/unit/playerObject.ts
+++ b/packages/game/src/lib/objects/unit/playerObject.ts
@@ -26,7 +26,7 @@ export class PlayerObject extends UnitObject implements GameObjectPlayer {
}
async init(character?: CharacterEditionWithCharacter): Promise {
- await this.#readFromDB()
+ // await this.#readFromDB()
super.initVisual(character)
}
diff --git a/packages/game/src/lib/services/baseAssetService.ts b/packages/game/src/lib/services/baseAssetService.ts
new file mode 100644
index 0000000..392bd1d
--- /dev/null
+++ b/packages/game/src/lib/services/baseAssetService.ts
@@ -0,0 +1,97 @@
+import type { AssetService, GameAddon } from '../types'
+import { Assets, Sprite } from 'pixi.js'
+import tree1Blue from '../assets/images/objects/tree/1/blue.png'
+import tree1Green from '../assets/images/objects/tree/1/green.png'
+import tree1Stone from '../assets/images/objects/tree/1/stone.png'
+import tree1Teal from '../assets/images/objects/tree/1/teal.png'
+import tree1Toxic from '../assets/images/objects/tree/1/toxic.png'
+import tree1Violet from '../assets/images/objects/tree/1/violet.png'
+import tree2Blue from '../assets/images/objects/tree/2/blue.png'
+import tree2Green from '../assets/images/objects/tree/2/green.png'
+import tree2Stone from '../assets/images/objects/tree/2/stone.png'
+import tree2Teal from '../assets/images/objects/tree/2/teal.png'
+import tree2Toxic from '../assets/images/objects/tree/2/toxic.png'
+import tree2Violet from '../assets/images/objects/tree/2/violet.png'
+import tree3Blue from '../assets/images/objects/tree/3/blue.png'
+import tree3Green from '../assets/images/objects/tree/3/green.png'
+import tree3Stone from '../assets/images/objects/tree/3/stone.png'
+import tree3Teal from '../assets/images/objects/tree/3/teal.png'
+import tree3Toxic from '../assets/images/objects/tree/3/toxic.png'
+import tree3Violet from '../assets/images/objects/tree/3/violet.png'
+import tree4Blue from '../assets/images/objects/tree/4/blue.png'
+import tree4Green from '../assets/images/objects/tree/4/green.png'
+import tree4Stone from '../assets/images/objects/tree/4/stone.png'
+import tree4Teal from '../assets/images/objects/tree/4/teal.png'
+import tree4Toxic from '../assets/images/objects/tree/4/toxic.png'
+import tree4Violet from '../assets/images/objects/tree/4/violet.png'
+import tree5Blue from '../assets/images/objects/tree/5/blue.png'
+import tree5Green from '../assets/images/objects/tree/5/green.png'
+import tree5Stone from '../assets/images/objects/tree/5/stone.png'
+import tree5Teal from '../assets/images/objects/tree/5/teal.png'
+import tree5Toxic from '../assets/images/objects/tree/5/toxic.png'
+import tree5Violet from '../assets/images/objects/tree/5/violet.png'
+import wagonEngineCloud1 from '../assets/images/objects/wagon/clouds/1.png'
+import wagonEngineCloud2 from '../assets/images/objects/wagon/clouds/2.png'
+import wagonEngineCloud3 from '../assets/images/objects/wagon/clouds/3.png'
+import wagonEngineCloud4 from '../assets/images/objects/wagon/clouds/4.png'
+import wagonEngine from '../assets/images/objects/wagon/engine-1.png'
+import wagonBase1 from '../assets/images/objects/wagon/wagon-1.png'
+import wagonBase2 from '../assets/images/objects/wagon/wagon-2.png'
+import wagonWheel from '../assets/images/objects/wagon/wheel-1.png'
+
+export class BaseAssetService implements AssetService {
+ #trees = [
+ { alias: 'TREE_1_GREEN', src: tree1Green },
+ { alias: 'TREE_2_GREEN', src: tree2Green },
+ { alias: 'TREE_3_GREEN', src: tree3Green },
+ { alias: 'TREE_4_GREEN', src: tree4Green },
+ { alias: 'TREE_5_GREEN', src: tree5Green },
+ { alias: 'TREE_1_BLUE', src: tree1Blue },
+ { alias: 'TREE_2_BLUE', src: tree2Blue },
+ { alias: 'TREE_3_BLUE', src: tree3Blue },
+ { alias: 'TREE_4_BLUE', src: tree4Blue },
+ { alias: 'TREE_5_BLUE', src: tree5Blue },
+ { alias: 'TREE_1_STONE', src: tree1Stone },
+ { alias: 'TREE_2_STONE', src: tree2Stone },
+ { alias: 'TREE_3_STONE', src: tree3Stone },
+ { alias: 'TREE_4_STONE', src: tree4Stone },
+ { alias: 'TREE_5_STONE', src: tree5Stone },
+ { alias: 'TREE_1_TEAL', src: tree1Teal },
+ { alias: 'TREE_2_TEAL', src: tree2Teal },
+ { alias: 'TREE_3_TEAL', src: tree3Teal },
+ { alias: 'TREE_4_TEAL', src: tree4Teal },
+ { alias: 'TREE_5_TEAL', src: tree5Teal },
+ { alias: 'TREE_1_TOXIC', src: tree1Toxic },
+ { alias: 'TREE_2_TOXIC', src: tree2Toxic },
+ { alias: 'TREE_3_TOXIC', src: tree3Toxic },
+ { alias: 'TREE_4_TOXIC', src: tree4Toxic },
+ { alias: 'TREE_5_TOXIC', src: tree5Toxic },
+ { alias: 'TREE_1_VIOLET', src: tree1Violet },
+ { alias: 'TREE_2_VIOLET', src: tree2Violet },
+ { alias: 'TREE_3_VIOLET', src: tree3Violet },
+ { alias: 'TREE_4_VIOLET', src: tree4Violet },
+ { alias: 'TREE_5_VIOLET', src: tree5Violet },
+ ]
+
+ #wagon = [
+ { alias: 'WAGON_BASE_1', src: wagonBase1 },
+ { alias: 'WAGON_BASE_2', src: wagonBase2 },
+ { alias: 'WAGON_ENGINE', src: wagonEngine },
+ { alias: 'WAGON_WHEEL', src: wagonWheel },
+ { alias: 'WAGON_ENGINE_CLOUD_1', src: wagonEngineCloud1 },
+ { alias: 'WAGON_ENGINE_CLOUD_2', src: wagonEngineCloud2 },
+ { alias: 'WAGON_ENGINE_CLOUD_3', src: wagonEngineCloud3 },
+ { alias: 'WAGON_ENGINE_CLOUD_4', src: wagonEngineCloud4 },
+ ]
+
+ constructor(protected addon: GameAddon) {}
+
+ sprite(alias: string) {
+ return Sprite.from(alias)
+ }
+
+ async load() {
+ await Assets.load(this.#trees)
+ await Assets.load(this.#wagon)
+ }
+}
diff --git a/packages/game/src/lib/services/baseTreeService.ts b/packages/game/src/lib/services/baseTreeService.ts
index eef44d0..c81effc 100644
--- a/packages/game/src/lib/services/baseTreeService.ts
+++ b/packages/game/src/lib/services/baseTreeService.ts
@@ -3,7 +3,7 @@ import { TreeObject } from '../objects/treeObject'
import { getRandomInRange } from '../utils/random'
export class BaseTreeService implements TreeService {
- #treesPerfectAmount = 30
+ #treesPerfectAmount = 200
#trees: TreeObject[] = []
constructor(readonly addon: GameAddon) {}
@@ -18,8 +18,8 @@ export class BaseTreeService implements TreeService {
}
init() {
- for (let i = 0; i < 20; i++) {
- const tree = new TreeObject({ addon: this.addon, x: getRandomInRange(0, 1000), y: this.addon.bottomY, size: getRandomInRange(50, 100) })
+ for (let i = 0; i < 50; i++) {
+ const tree = new TreeObject({ addon: this.addon, x: getRandomInRange(0, 10000), y: this.addon.bottomY, size: getRandomInRange(50, 100) })
this.addon.app.stage.addChild(tree)
this.addon.addChild(tree)
this.#trees.push(tree)
@@ -27,7 +27,7 @@ export class BaseTreeService implements TreeService {
}
#plant() {
- const tree = new TreeObject({ addon: this.addon, x: getRandomInRange(0, 1000), y: this.addon.bottomY, size: getRandomInRange(4, 8) })
+ const tree = new TreeObject({ addon: this.addon, x: getRandomInRange(0, 10000), y: this.addon.bottomY, size: getRandomInRange(4, 8) })
this.addon.app.stage.addChild(tree)
this.addon.addChild(tree)
this.#trees.push(tree)
diff --git a/packages/game/src/lib/services/baseWebSocketService.ts b/packages/game/src/lib/services/baseWebSocketService.ts
index e86b2e5..27aaf04 100644
--- a/packages/game/src/lib/services/baseWebSocketService.ts
+++ b/packages/game/src/lib/services/baseWebSocketService.ts
@@ -1,18 +1,40 @@
import type { WebSocketConnect, WebSocketEvents, WebSocketMessage } from '@chat-game/types'
import type { GameAddon, WebSocketService } from '../types'
import { createId } from '@paralleldrive/cuid2'
+import { useWebSocket } from '@vueuse/core'
import { TreeObject } from '../objects/treeObject'
export class BaseWebSocketService implements WebSocketService {
- #socket!: WebSocket
- roomId: string | null = null
+ socket: WebSocketService['socket']
- constructor(readonly addon: GameAddon, readonly websocketUrl: string) {}
+ constructor(readonly addon: GameAddon, readonly websocketUrl: string) {
+ this.socket = useWebSocket(this.websocketUrl, {
+ autoReconnect: true,
+ heartbeat: {
+ message: 'ping',
+ interval: 10000,
+ pongTimeout: 10000,
+ },
+ })
+
+ this.socket.ws.value?.addEventListener('message', (event) => {
+ if (event.data.toString() === 'pong') {
+ return
+ }
+
+ const message = this.#parse(event.data.toString())
+ if (!message) {
+ return
+ }
+
+ void this.#handleMessage(message)
+ })
+ }
connect(roomId: string) {
- this.#socket = new WebSocket(this.websocketUrl)
+ this.socket.open()
- this.#socket.onopen = () => {
+ if (this.socket.status.value === 'CONNECTING' || this.socket.status.value === 'OPEN') {
const connectMessage: WebSocketConnect = {
type: 'CONNECT',
data: {
@@ -20,24 +42,13 @@ export class BaseWebSocketService implements WebSocketService {
id: roomId,
},
}
- this.#socket.send(JSON.stringify({ id: createId(), ...connectMessage }))
-
- this.roomId = roomId
+ this.socket.send(JSON.stringify({ id: createId(), ...connectMessage }))
}
-
- this.#socket.addEventListener('message', (event) => {
- const message = this.#parse(event.data.toString())
- if (!message) {
- return
- }
-
- void this.#handleMessage(message)
- })
}
send(event: WebSocketEvents) {
const preparedMessage = JSON.stringify({ ...event, id: createId() })
- this.#socket.send(preparedMessage)
+ this.socket.send(preparedMessage)
}
async #handleMessage(message: WebSocketMessage) {
diff --git a/packages/game/src/lib/types.ts b/packages/game/src/lib/types.ts
index 50bf5d4..5999ce8 100644
--- a/packages/game/src/lib/types.ts
+++ b/packages/game/src/lib/types.ts
@@ -3,8 +3,10 @@ import type {
Inventory,
Player,
WebSocketEvents,
+ WebSocketMessage,
} from '@chat-game/types'
-import type { Application, Container } from 'pixi.js'
+import type { UseWebSocketReturn } from '@vueuse/core'
+import type { Application, Container, Sprite } from 'pixi.js'
export interface GameAddon extends Container {
id: string
@@ -13,6 +15,7 @@ export interface GameAddon extends Container {
tick: number
bottomY: number
app: Application
+ assetService: AssetService
playerService: PlayerService
treeService: TreeService
serverService: ServerService
@@ -61,7 +64,12 @@ export interface GameObjectFlag extends GameObject {
}
export interface GameObjectTree extends GameObject {
- variant: 'GREEN'
+ variant: 'GREEN' | 'VIOLET' | 'STONE' | 'TEAL' | 'TOXIC' | 'BLUE'
+ treeType: '1' | '2' | '3' | '4' | '5'
+}
+
+export interface GameObjectWagon extends GameObject {
+ setNearestTarget: () => void
}
export interface GameObjectUnit extends GameObject {
@@ -105,7 +113,7 @@ export interface ServerService {
}
export interface WebSocketService {
- roomId: string | null
+ socket: UseWebSocketReturn
connect: (roomId: string) => void
send: (event: WebSocketEvents) => void
}
@@ -119,6 +127,10 @@ export interface PlayerService {
) => Promise
}
+export interface AssetService {
+ sprite: (alias: string) => Sprite
+}
+
export interface TreeService {
update: () => void
init: () => void
@@ -134,7 +146,7 @@ export type GameObjectState =
export type GameObjectDirection = 'LEFT' | 'RIGHT'
-type GameObjectType = 'PLAYER' | 'RAIDER' | 'FLAG' | 'TREE'
+type GameObjectType = 'PLAYER' | 'RAIDER' | 'FLAG' | 'TREE' | 'WAGON'
export interface Script {
id: string
diff --git a/packages/game/tsconfig.json b/packages/game/tsconfig.json
index 577ab0e..4802c20 100644
--- a/packages/game/tsconfig.json
+++ b/packages/game/tsconfig.json
@@ -1,7 +1,10 @@
{
"compilerOptions": {
"target": "ESNext",
- "module": "commonjs",
+ "lib": ["ESNext", "DOM"],
+ "rootDir": "./src",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
@@ -10,6 +13,7 @@
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
+ "include": ["src/lib/**/*"],
"exclude": [
".turbo",
"dist",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7aaf86d..6de22da 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -48,8 +48,8 @@ importers:
specifier: workspace:*
version: link:../../packages/types
'@telegram-apps/sdk-vue':
- specifier: ^1.0.6
- version: 1.0.6(vue@3.5.13(typescript@5.6.2))
+ specifier: ^1.0.8
+ version: 1.0.8(vue@3.5.13(typescript@5.6.2))
vue:
specifier: ^3.5.13
version: 3.5.13(typescript@5.6.2)
@@ -68,7 +68,7 @@ importers:
version: 4.1.2(vue@3.5.13(typescript@5.6.2))
'@tailwindcss/vite':
specifier: 4.0.0-beta.4
- version: 4.0.0-beta.4(@babel/core@7.26.0)(postcss-load-config@4.0.2(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.6.2)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
+ version: 4.0.0-beta.4(@babel/core@7.26.0)(postcss-load-config@4.0.2(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.6.2)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
'@tsconfig/node22':
specifier: ^22.0.0
version: 22.0.0
@@ -77,7 +77,7 @@ importers:
version: 22.10.1
'@vitejs/plugin-vue':
specifier: ^5.2.1
- version: 5.2.1(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
+ version: 5.2.1(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
'@vue/tsconfig':
specifier: ^0.7.0
version: 0.7.0(typescript@5.6.2)(vue@3.5.13(typescript@5.6.2))
@@ -100,14 +100,14 @@ importers:
specifier: ^0.27.5
version: 0.27.5(@babel/parser@7.26.2)(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vue@3.5.13(typescript@5.6.2))
vite:
- specifier: ^6.0.1
- version: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ specifier: ^6.0.2
+ version: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
vite-plugin-terminal:
specifier: ^1.2.0
- version: 1.2.0(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
+ version: 1.2.0(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
vite-plugin-vue-devtools:
specifier: ^7.6.7
- version: 7.6.7(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
+ version: 7.6.7(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
vue-tsc:
specifier: ^2.1.10
version: 2.1.10(typescript@5.6.2)
@@ -245,6 +245,9 @@ importers:
'@paralleldrive/cuid2':
specifier: ^2.2.2
version: 2.2.2
+ '@vueuse/core':
+ specifier: ^12.0.0
+ version: 12.0.0(typescript@5.6.2)
pixi.js:
specifier: ^8.6.1
version: 8.6.1
@@ -1625,19 +1628,19 @@ packages:
peerDependencies:
vite: ^5.2.0
- '@telegram-apps/bridge@1.5.0':
- resolution: {integrity: sha512-usfvIf4eAIXoQ78u+3bvDcGCfKe/MYw0qlhG0EaqVqrj81cdwvjx2KB+t9NqqeUrfDsdfdqS+6W267rWyK/Uiw==}
+ '@telegram-apps/bridge@1.6.0':
+ resolution: {integrity: sha512-MPoTJoM6scpvFYgf87jNuiEBYfhjtgcliBTdVAvyNfMwBtXixJqfrXJpIIedmVxXt21h12I1EiyrDNxrT8aM7A==}
- '@telegram-apps/navigation@1.0.6':
- resolution: {integrity: sha512-r1VHoYjZ0RBSfk+ltokNHM1VX3vnKlN6pAWH6qjw/XQTGy4Rlp9w6IyqUPgtENWLKop//QT+xIumfmZRCIMwbA==}
+ '@telegram-apps/navigation@1.0.7':
+ resolution: {integrity: sha512-PDjyXBtudwRJX0QkPsT9zdNRkif2W0bpMv/gAkRmLskEmpw5IjqBMNvIvZwt+qiwlI/hciJMrwJpW3xHTz3ENA==}
- '@telegram-apps/sdk-vue@1.0.6':
- resolution: {integrity: sha512-v75FlE0VrNKJAFSjmoJpVk0CEunU03YGG9mdfBWDDbkEIhe0v41o1sV7grImUrMEiSu9x2OdhjLWQD26QN2znw==}
+ '@telegram-apps/sdk-vue@1.0.8':
+ resolution: {integrity: sha512-u/sAiYrZBjSfgejnGmK6HQxnJl2DXo/RCL4cTZuQKOZnlHKJfe8tytuVmKWmqHbUJum3qC4xDqO68oL6FyYsNw==}
peerDependencies:
vue: ^3.0.0
- '@telegram-apps/sdk@2.7.1':
- resolution: {integrity: sha512-Ze8HILMc2yKpXiR4hOdejZxBYErXKZK2E0ZJo6GHGpnTxMgzzYtW5TcG6aPhUqek5ytko+uHyscnPXoe7QdIqA==}
+ '@telegram-apps/sdk@2.8.1':
+ resolution: {integrity: sha512-UBufQc2A3KT11jVjVs4W5eE/GHL8ZL5tP9YFO6ApfGHLx13iUYb2LzwExxNjPik1n2FpRF6DxhoHNgn3sKubEA==}
'@telegram-apps/signals@1.1.0':
resolution: {integrity: sha512-5qN7cU8t3l7n0cKcnzc/1TYKJTwAggUinfwbLHL1SYmB47pBHjCvfsRiYliFohk6lb635SBmNuVZL6LHFmGZaw==}
@@ -5409,8 +5412,8 @@ packages:
terser:
optional: true
- vite@6.0.1:
- resolution: {integrity: sha512-Ldn6gorLGr4mCdFnmeAOLweJxZ34HjKnDm4HGo6P66IEqTxQb36VEdFJQENKxWjupNfoIjvRUnswjn1hpYEpjQ==}
+ vite@6.0.2:
+ resolution: {integrity: sha512-XdQ+VsY2tJpBsKGs0wf3U/+azx8BBpYRHFAyKm5VeEZNOJZRB63q7Sc8Iup3k0TrN3KO6QgyzFf+opSbfY1y0g==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
hasBin: true
peerDependencies:
@@ -7190,14 +7193,14 @@ snapshots:
'@tailwindcss/oxide-win32-arm64-msvc': 4.0.0-beta.4
'@tailwindcss/oxide-win32-x64-msvc': 4.0.0-beta.4
- '@tailwindcss/vite@4.0.0-beta.4(@babel/core@7.26.0)(postcss-load-config@4.0.2(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.6.2)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))':
+ '@tailwindcss/vite@4.0.0-beta.4(@babel/core@7.26.0)(postcss-load-config@4.0.2(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.6.2)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))':
dependencies:
'@tailwindcss/node': 4.0.0-beta.4
'@tailwindcss/oxide': 4.0.0-beta.4
lightningcss: 1.28.2
svelte-preprocess: 6.0.3(@babel/core@7.26.0)(postcss-load-config@4.0.2(postcss@8.4.49))(postcss@8.4.49)(svelte@5.2.11)(typescript@5.6.2)
tailwindcss: 4.0.0-beta.4
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
transitivePeerDependencies:
- '@babel/core'
- coffeescript
@@ -7211,28 +7214,28 @@ snapshots:
- svelte
- typescript
- '@telegram-apps/bridge@1.5.0':
+ '@telegram-apps/bridge@1.6.0':
dependencies:
'@telegram-apps/signals': 1.1.0
'@telegram-apps/toolkit': 1.0.0
'@telegram-apps/transformers': 1.1.0
'@telegram-apps/types': 1.1.0
- '@telegram-apps/navigation@1.0.6':
+ '@telegram-apps/navigation@1.0.7':
dependencies:
- '@telegram-apps/bridge': 1.5.0
+ '@telegram-apps/bridge': 1.6.0
'@telegram-apps/signals': 1.1.0
'@telegram-apps/toolkit': 1.0.0
- '@telegram-apps/sdk-vue@1.0.6(vue@3.5.13(typescript@5.6.2))':
+ '@telegram-apps/sdk-vue@1.0.8(vue@3.5.13(typescript@5.6.2))':
dependencies:
- '@telegram-apps/sdk': 2.7.1
+ '@telegram-apps/sdk': 2.8.1
vue: 3.5.13(typescript@5.6.2)
- '@telegram-apps/sdk@2.7.1':
+ '@telegram-apps/sdk@2.8.1':
dependencies:
- '@telegram-apps/bridge': 1.5.0
- '@telegram-apps/navigation': 1.0.6
+ '@telegram-apps/bridge': 1.6.0
+ '@telegram-apps/navigation': 1.0.7
'@telegram-apps/signals': 1.1.0
'@telegram-apps/toolkit': 1.0.0
'@telegram-apps/transformers': 1.1.0
@@ -7559,9 +7562,9 @@ snapshots:
vite: 5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)
vue: 3.5.13(typescript@5.6.2)
- '@vitejs/plugin-vue@5.2.1(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))':
+ '@vitejs/plugin-vue@5.2.1(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))':
dependencies:
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
vue: 3.5.13(typescript@5.6.2)
'@vitest/eslint-plugin@1.1.12(@typescript-eslint/utils@8.16.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.2))(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.2)':
@@ -7675,14 +7678,14 @@ snapshots:
transitivePeerDependencies:
- vite
- '@vue/devtools-core@7.6.7(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))':
+ '@vue/devtools-core@7.6.7(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))':
dependencies:
'@vue/devtools-kit': 7.6.7
'@vue/devtools-shared': 7.6.7
mitt: 3.0.1
nanoid: 5.0.9
pathe: 1.1.2
- vite-hot-client: 0.2.4(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
+ vite-hot-client: 0.2.4(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
vue: 3.5.13(typescript@5.6.2)
transitivePeerDependencies:
- vite
@@ -11531,9 +11534,9 @@ snapshots:
dependencies:
vite: 5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.36.0)
- vite-hot-client@0.2.4(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
+ vite-hot-client@0.2.4(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
dependencies:
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
vite-node@2.1.6(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1):
dependencies:
@@ -11541,7 +11544,7 @@ snapshots:
debug: 4.3.7(supports-color@9.4.0)
es-module-lexer: 1.5.4
pathe: 1.1.2
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
transitivePeerDependencies:
- '@types/node'
- jiti
@@ -11597,7 +11600,7 @@ snapshots:
- rollup
- supports-color
- vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
+ vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
dependencies:
'@antfu/utils': 0.7.10
'@rollup/pluginutils': 5.1.3(rollup@4.27.4)
@@ -11608,35 +11611,35 @@ snapshots:
perfect-debounce: 1.0.0
picocolors: 1.1.1
sirv: 3.0.0
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
optionalDependencies:
'@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.4)
transitivePeerDependencies:
- rollup
- supports-color
- vite-plugin-terminal@1.2.0(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
+ vite-plugin-terminal@1.2.0(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
dependencies:
'@rollup/plugin-strip': 3.0.4(rollup@4.27.4)
debug: 4.3.7(supports-color@9.4.0)
kolorist: 1.8.0
sirv: 2.0.4
ufo: 1.5.4
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
transitivePeerDependencies:
- rollup
- supports-color
- vite-plugin-vue-devtools@7.6.7(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2)):
+ vite-plugin-vue-devtools@7.6.7(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2)):
dependencies:
- '@vue/devtools-core': 7.6.7(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
+ '@vue/devtools-core': 7.6.7(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))(vue@3.5.13(typescript@5.6.2))
'@vue/devtools-kit': 7.6.7
'@vue/devtools-shared': 7.6.7
execa: 9.5.1
sirv: 3.0.0
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
- vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
- vite-plugin-vue-inspector: 5.3.1(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.4))(rollup@4.27.4)(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
+ vite-plugin-vue-inspector: 5.3.1(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1))
transitivePeerDependencies:
- '@nuxt/kit'
- rollup
@@ -11658,7 +11661,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- vite-plugin-vue-inspector@5.3.1(vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
+ vite-plugin-vue-inspector@5.3.1(vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)):
dependencies:
'@babel/core': 7.26.0
'@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0)
@@ -11669,7 +11672,7 @@ snapshots:
'@vue/compiler-dom': 3.5.13
kolorist: 1.8.0
magic-string: 0.30.14
- vite: 6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
+ vite: 6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1)
transitivePeerDependencies:
- supports-color
@@ -11684,7 +11687,7 @@ snapshots:
lightningcss: 1.28.2
terser: 5.36.0
- vite@6.0.1(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1):
+ vite@6.0.2(@types/node@22.10.1)(jiti@2.4.0)(lightningcss@1.28.2)(terser@5.36.0)(yaml@2.6.1):
dependencies:
esbuild: 0.24.0
postcss: 8.4.49