From dff149254c2f8bb1d4a5523a779730921ef7ab30 Mon Sep 17 00:00:00 2001 From: Lajos Meszaros Date: Thu, 7 Sep 2023 20:40:56 +0200 Subject: [PATCH] feat(leftCorridor): add last pc game --- src/rooms/leftCorridor.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/rooms/leftCorridor.ts b/src/rooms/leftCorridor.ts index 3af8cf3..cb3e35d 100644 --- a/src/rooms/leftCorridor.ts +++ b/src/rooms/leftCorridor.ts @@ -5,7 +5,7 @@ import { circleOfVectors } from 'arx-level-generator/utils' import { MathUtils } from 'three' import { GameDisplay } from '@/entities/GameDisplay.js' import { Mirror } from '@/entities/Mirror.js' -import { PCGameVariant, pcGameVariants } from '@/entities/PCGame.js' +import { PCGame, PCGameVariant, pcGameVariants } from '@/entities/PCGame.js' import { RoomContents } from '@/types.js' export const createLeftCorridor = async ( @@ -109,9 +109,22 @@ export const createLeftCorridor = async ( }) }) + const game = new PCGame({ + variant: gameVariant, + position: new Vector3(-2660, 0, 340), + orientation: new Rotation( + MathUtils.degToRad(-90) + 7 * angle + theta, + MathUtils.degToRad(180), + MathUtils.degToRad(-90), + ), + }) + game.script?.on('inventoryin', () => { + return `sendevent player_found_a_game ${gameStateManager.ref} ${game.variant}` + }) + return { meshes: [...bases], - entities: [rootMirror, mirror, ...Object.values(gameDisplays)], + entities: [rootMirror, mirror, ...Object.values(gameDisplays), game], lights: [], zones: [], _: {},