Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Zikoat committed Aug 2, 2024
1 parent 4d65e5a commit 6538bc3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<button onclick="toggleMenu()" class="menubutton ui">
<img alt="menu button" id="menubutton" />
</button>
<!-- todo change visuals of menu to not be a square, but to only be the icon with a white "shadow" around the icon contours. -->
<div class="menu ui" id="menu" style="display: none">
<div><a href="https://discord.gg/XzpSVxx">Discord</a></div>
<div>
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
"description": "An infinite, open source, minesweeper implementation. Perfect for creating bots, and based on borbit's mienfield.com",
"scripts": {
"dev": "vite --open",
"check": "bun i && eslint --ext .js,.jsx,.ts,.tsx ./src --fix && prettier --write . && bun ci && vite preview --open",
"ci": "bun install --production && prettier --check . && tsc --noemit && vite build",
"test": "vitest",
"clean": "git clean -Xdf",
"lint": "eslint --ext .js,.jsx,.ts,.tsx ./src --fix && prettier --write .",
"test-single": "uvu -r tsm",
"test-watch": "watchlist -e src -- bun run test-single",
"ci": "bun install --production && prettier --check . && vite build",
"localci": "rm ./bun.lockb && bun i && bun lint && bun clean && bun ci && vite preview --open",
"build": "vite build",
"type": "tsc --noemit"
"test-watch": "watchlist -e src -- bun run test-single"
},
"repository": {
"type": "git",
Expand Down
34 changes: 18 additions & 16 deletions src/FieldRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ export class FieldRenderer extends PIXI.Application {
}

// todo: bug when i reset the game to reset the camera to 0,0, then the cell at 0,0 flashes with the "zoom out to spawn" animation every time the camera moves a pixel.
const app = new PIXI.Application();

await app.init({
resizeTo: window,
backgroundColor: 0x1099bb,
});

document.body.appendChild(app.canvas);

PIXI.TextureSource.defaultOptions.scaleMode = "nearest";

const fieldContainer = new PIXI.Container();
const clickHandler = new PIXI.Container();
clickHandler.eventMode = "static";
app.stage.addChild(clickHandler);

function updateCell(field: Field, cell: Cell & { sprite?: CellSprite }) {
if (cell.sprite === undefined) {
const value = field.value(cell.x, cell.y);
Expand Down Expand Up @@ -127,3 +111,21 @@ function setup(

console.log("done setup");
}

const app = new PIXI.Application();
const fieldContainer = new PIXI.Container();
const clickHandler = new PIXI.Container();

(async () => {
await app.init({
resizeTo: window,
backgroundColor: 0x1099bb,
});

document.body.appendChild(app.canvas);

PIXI.TextureSource.defaultOptions.scaleMode = "nearest";

clickHandler.eventMode = "static";
app.stage.addChild(clickHandler);
})();
3 changes: 0 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { defineConfig } from "vite";

export default defineConfig({
base: "/infinite-minesweeper/",
build: {
target: "esnext",
},
resolve: {
alias: {
crypto: "src/empty.ts",
Expand Down

0 comments on commit 6538bc3

Please sign in to comment.