From 1e0795da9ff1905261cd26aea27ee6a5d04bfcb9 Mon Sep 17 00:00:00 2001 From: Disguied-Coffee Date: Mon, 12 Aug 2024 21:19:58 -0500 Subject: [PATCH] Troubleshoot solution #3? --- index.html | 4 +--- src/main.js | 16 +++------------- src/sheet.js | 28 ++++++++++++++++++++++------ vite.config.js | 17 +++++++++++------ 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index 0b07d0f..899893b 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,6 @@ THIS IS A TEST - - @@ -16,7 +14,7 @@

OPPA
STOPPA

diff --git a/src/main.js b/src/main.js index beae163..6529b82 100644 --- a/src/main.js +++ b/src/main.js @@ -1,6 +1,7 @@ import {default as CN} from './constants'; import Phaser from 'phaser'; +import initDocQueries from './sheet'; // import js from 'easystarjs'; @@ -281,19 +282,6 @@ class Player { // Add any other player-specific methods here } -//FEATURE -document.getElementById("start").addEventListener("click", (e) => { - if (game.isPaused) game.resume(); - else game.pause(); - - isPaused = !isPaused; -}); -document.getElementById("pause").addEventListener("click", (e) => { - if (game.isPaused) game.resume(); - else game.pause(); - - isPaused = !isPaused; -}); //we need at least a 5:4 ratio for the coord sys @@ -314,3 +302,5 @@ const config = { var game = new Phaser.Game(config); + +initDocQueries(game); diff --git a/src/sheet.js b/src/sheet.js index 4e12ab3..c12e933 100644 --- a/src/sheet.js +++ b/src/sheet.js @@ -3,10 +3,26 @@ */ -function start(){ - var menu = document.querySelector(".menu"); - var main = document.querySelector("main"); +export default function initDocQueries(gameScene) { + document.getElementById("start").addEventListener("click", (e) => { + var menu = document.querySelector(".menu"); + var main = document.querySelector("main"); - menu.style.display = "none"; - main.style.filter = "blur(0px)"; -} \ No newline at end of file + menu.style.display = "none"; + main.style.filter = "blur(0px)"; + }) + + //FEATURE + document.getElementById("start").addEventListener("click", (e) => { + if (gameScene.isPaused) gameScene.resume(); + else gameScene.pause(); + + isPaused = !isPaused; + }); + document.getElementById("pause").addEventListener("click", (e) => { + if (gameScene.isPaused) gameScene.resume(); + else gameScene.pause(); + + isPaused = !isPaused; + }); +} diff --git a/vite.config.js b/vite.config.js index 6f1513d..4593593 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,12 +1,17 @@ +import { build } from "vite"; + // vite.config.js export default { base: '/project-car-hunt/', rollupOptions: { output: { - manualChunks: false, - inlineDynamicImports: true, - entryFileNames: '[name].js', // currently does not work for the legacy bundle - assetFileNames: '[name].[ext]', // currently does not work for images + manualChunks: false, + inlineDynamicImports: true, + entryFileNames: '[name].js', // currently does not work for the legacy bundle + assetFileNames: '[name].[ext]', // currently does not work for images }, - } - } \ No newline at end of file + }, + build: { + assetsInlineLimit: 0, + }, +} \ No newline at end of file