Fix refactor

This commit is contained in:
lanxu 2024-10-27 20:00:46 +02:00
parent eb823f1798
commit e7b1ec7f21
16 changed files with 6379 additions and 14 deletions

14
dist/assets.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"frames": [],
"meta": {
"app": "libgdx",
"version": "latest",
"image": "atlas.png",
"format": "png",
"size": {
"w": 10,
"h": 10
},
"scale": 1
}
}

BIN
dist/assets/01.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

BIN
dist/assets/02.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

BIN
dist/assets/atlas.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
dist/assets/card.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

6345
dist/assets/index-CS9tYjbg.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
dist/assets/panel-000.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
dist/assets/panel-border-000.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

15
dist/index.html vendored Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello wasm-pack!</title>
<script type="module" crossorigin src="./assets/index-CS9tYjbg.js"></script>
</head>
<body>
<div id="silver-fang-mini-game"></div>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
</body>
</html>

View File

@ -9,7 +9,7 @@
<body> <body>
<div id="silver-fang-mini-game"></div> <div id="silver-fang-mini-game"></div>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript> <noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script type="module" src="/bootstrap.ts"></script> <script type="module" src="/src/index.ts"></script>
</body> </body>
</html> </html>

View File

@ -2,15 +2,10 @@
"name": "silver-fang-mini-game", "name": "silver-fang-mini-game",
"version": "0.1.0", "version": "0.1.0",
"description": "Silver Fang Mini Game", "description": "Silver Fang Mini Game",
"main": "index.js",
"bin": {
"create-wasm-app": ".bin/create-wasm-app.js"
},
"scripts": { "scripts": {
"build": "tsc && vite build", "build": "tsc && vite build",
"start": "vite" "start": "vite"
}, },
"homepage": "https://github.com/rustwasm/create-wasm-app#readme",
"devDependencies": { "devDependencies": {
"typescript": "^5.6.3", "typescript": "^5.6.3",
"vite": "^5.4.9" "vite": "^5.4.9"

View File

@ -1,5 +0,0 @@
// A dependency graph that contains any wasm must all be imported
// asynchronously. This `bootstrap.js` file does the single async import, so
// that no one else needs to worry about it again.
import("./index")
.catch(e => console.error("Error importing `index.ts`:", e));

View File

@ -1,6 +1,6 @@
// import * as MiniGame from "mini-game"; // import * as MiniGame from "mini-game";
import * as Phaser from "phaser"; import * as Phaser from "phaser";
import MainMenuScene from "./scenes/main-menu-scene"; import MainMenuScene from "./scenes/main-menu";
const GameConfig: Phaser.Types.Core.GameConfig = { const GameConfig: Phaser.Types.Core.GameConfig = {
title: 'ExampleGame', title: 'ExampleGame',

View File

@ -1,5 +1,5 @@
//wasm.greet(); //wasm.greet();
import Game from "./src/game-base"; import Game from "./game-base";
const game = new Game({ parent: 'silver-fang-minigame' }); new Game({ parent: 'silver-fang-minigame' });

View File

@ -23,6 +23,7 @@ class GameButton {
const buttonGroup = new Phaser.GameObjects.Group(scene) const buttonGroup = new Phaser.GameObjects.Group(scene)
buttonGroup.add(textObject) buttonGroup.add(textObject)
buttonGroup.add(topLeft) buttonGroup.add(topLeft)
buttonGroup.add(top)
buttonGroup.add(topRight) buttonGroup.add(topRight)
this.group = buttonGroup this.group = buttonGroup