From 7eb7eb068afc24d30caaaa8a09343959289404b8 Mon Sep 17 00:00:00 2001 From: goynov Date: Thu, 28 Aug 2025 20:14:37 +0300 Subject: [PATCH] refactor --- src/components/GamePlaying/GamePlaying.vue | 10 ++-- .../InteractiveObjects}/Grass.js | 0 src/components/InteractiveObjects/Grass.vue | 0 .../InteractiveObjects/PuzzleGame1.js} | 2 +- .../InteractiveObjects/PuzzleGame1.vue | 0 .../InteractiveObjects/PuzzleGame2.js} | 2 +- .../InteractiveObjects/PuzzleGame4.js} | 2 +- .../InteractiveObjects}/VideoPlayer.js | 2 - .../InteractiveObjects/VideoPlayer.vue | 60 +++++++++++++++++++ 9 files changed, 68 insertions(+), 10 deletions(-) rename src/{lib/interactive-objects => components/InteractiveObjects}/Grass.js (100%) create mode 100644 src/components/InteractiveObjects/Grass.vue rename src/{lib/interactive-objects/Game1.js => components/InteractiveObjects/PuzzleGame1.js} (97%) create mode 100644 src/components/InteractiveObjects/PuzzleGame1.vue rename src/{lib/interactive-objects/Game2.js => components/InteractiveObjects/PuzzleGame2.js} (98%) rename src/{lib/interactive-objects/Game4.js => components/InteractiveObjects/PuzzleGame4.js} (98%) rename src/{lib/interactive-objects => components/InteractiveObjects}/VideoPlayer.js (97%) create mode 100644 src/components/InteractiveObjects/VideoPlayer.vue diff --git a/src/components/GamePlaying/GamePlaying.vue b/src/components/GamePlaying/GamePlaying.vue index aafbcc5..e3ddecb 100644 --- a/src/components/GamePlaying/GamePlaying.vue +++ b/src/components/GamePlaying/GamePlaying.vue @@ -54,11 +54,11 @@ import { GameEngine } from '@/lib/GameEngine'; import { Hero } from '@/lib/Hero'; -import { Game1 } from '@/lib/interactive-objects/Game1'; -import { Game2 } from '@/lib/interactive-objects/Game2'; -import { Game4 } from '@/lib/interactive-objects/Game4'; -import { Grass } from '@/lib/interactive-objects/Grass'; -import { VideoPlayer } from '@/lib/interactive-objects/VideoPlayer'; +import { Game1 } from '@/components/InteractiveObjects/PuzzleGame1'; +import { Game2 } from '@/components/InteractiveObjects/PuzzleGame2'; +import { Game4 } from '@/components/InteractiveObjects/PuzzleGame4'; +import { Grass } from '@/components/InteractiveObjects/Grass'; +import { VideoPlayer } from '@/components/InteractiveObjects/VideoPlayer'; import { useAppStore } from '@/stores/app'; const store = useAppStore(); diff --git a/src/lib/interactive-objects/Grass.js b/src/components/InteractiveObjects/Grass.js similarity index 100% rename from src/lib/interactive-objects/Grass.js rename to src/components/InteractiveObjects/Grass.js diff --git a/src/components/InteractiveObjects/Grass.vue b/src/components/InteractiveObjects/Grass.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/interactive-objects/Game1.js b/src/components/InteractiveObjects/PuzzleGame1.js similarity index 97% rename from src/lib/interactive-objects/Game1.js rename to src/components/InteractiveObjects/PuzzleGame1.js index fa69f04..0f39096 100644 --- a/src/lib/interactive-objects/Game1.js +++ b/src/components/InteractiveObjects/PuzzleGame1.js @@ -1,6 +1,6 @@ import { BoxGeometry, Mesh, MeshBasicMaterial, Group } from 'three'; import { TextureLoader } from 'three/src/loaders/TextureLoader'; -import { MotionEngine } from '../MotionEngine'; +import { MotionEngine } from '../../lib/MotionEngine'; class Game1 { constructor(context, image, w, h) { diff --git a/src/components/InteractiveObjects/PuzzleGame1.vue b/src/components/InteractiveObjects/PuzzleGame1.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/interactive-objects/Game2.js b/src/components/InteractiveObjects/PuzzleGame2.js similarity index 98% rename from src/lib/interactive-objects/Game2.js rename to src/components/InteractiveObjects/PuzzleGame2.js index 3a1df60..dd696e6 100644 --- a/src/lib/interactive-objects/Game2.js +++ b/src/components/InteractiveObjects/PuzzleGame2.js @@ -1,6 +1,6 @@ import { BoxGeometry, Mesh, MeshBasicMaterial, Group } from 'three'; import { TextureLoader } from 'three/src/loaders/TextureLoader'; -import { MotionEngine } from '../MotionEngine'; +import { MotionEngine } from '../../lib/MotionEngine'; class Game2 { constructor(context, image, w, h) { diff --git a/src/lib/interactive-objects/Game4.js b/src/components/InteractiveObjects/PuzzleGame4.js similarity index 98% rename from src/lib/interactive-objects/Game4.js rename to src/components/InteractiveObjects/PuzzleGame4.js index 957821a..64d91e9 100644 --- a/src/lib/interactive-objects/Game4.js +++ b/src/components/InteractiveObjects/PuzzleGame4.js @@ -1,6 +1,6 @@ import { Group, RGBAFormat } from 'three'; import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; -import { MotionEngine } from '../MotionEngine'; +import { MotionEngine } from '../../lib/MotionEngine'; var Game4 = function(context, gltf, w, h){ this.game = new Group(); diff --git a/src/lib/interactive-objects/VideoPlayer.js b/src/components/InteractiveObjects/VideoPlayer.js similarity index 97% rename from src/lib/interactive-objects/VideoPlayer.js rename to src/components/InteractiveObjects/VideoPlayer.js index f3c0526..0516dae 100644 --- a/src/lib/interactive-objects/VideoPlayer.js +++ b/src/components/InteractiveObjects/VideoPlayer.js @@ -2,7 +2,6 @@ import * as THREE from 'three'; class VideoPlayer { - constructor(context, video, w, h){ let geometry = new THREE.PlaneGeometry( w, h ); let map = new THREE.VideoTexture( video ); @@ -25,7 +24,6 @@ class VideoPlayer { } }); } - } export {VideoPlayer} \ No newline at end of file diff --git a/src/components/InteractiveObjects/VideoPlayer.vue b/src/components/InteractiveObjects/VideoPlayer.vue new file mode 100644 index 0000000..2bedd65 --- /dev/null +++ b/src/components/InteractiveObjects/VideoPlayer.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file