Skip to content

Commit

Permalink
Troubleshoot solution #3?
Browse files Browse the repository at this point in the history
  • Loading branch information
Disguised-Coffee committed Aug 13, 2024
1 parent e15a1d9 commit 1e0795d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>THIS IS A TEST</title>
<link href="style.css" rel="stylesheet">
<script defer src="src/sheet.js"></script>

</head>

<body>
Expand All @@ -16,7 +14,7 @@ <h1>OPPA<br>STOPPA</h1>

<div class="menu-buttons">
<h2>Ready to run from the opps?</h2>
<button id="start" onclick="start()">Start?</button>
<button id="start">Start?</button>
</div>
</div>
<main>
Expand Down
16 changes: 3 additions & 13 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {default as CN} from './constants';

import Phaser from 'phaser';
import initDocQueries from './sheet';
// import js from 'easystarjs';


Expand Down Expand Up @@ -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

Expand All @@ -314,3 +302,5 @@ const config = {


var game = new Phaser.Game(config);

initDocQueries(game);
28 changes: 22 additions & 6 deletions src/sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
}
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;
});
}
17 changes: 11 additions & 6 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -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
},
}
}
},
build: {
assetsInlineLimit: 0,
},
}

0 comments on commit 1e0795d

Please sign in to comment.