Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.8.1 #54

Merged
merged 9 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added loading progress
  • Loading branch information
neki-dev committed Sep 26, 2023
commit a72515ca1678a110d4d5ba09f119177340e1dbba
8 changes: 4 additions & 4 deletions src/assets/styles.css
Original file line number Diff line number Diff line change
@@ -26,11 +26,11 @@ img {
flex-direction: column;
display: flex;
padding: 100px;
font: 20px 'Verdana';
font: 14px 'Verdana';
font-weight: bold;
line-height: 20pt;
letter-spacing: 2px;
color: #aaa;
line-height: 14pt;
letter-spacing: 1px;
color: #fff;
text-align: center;
z-index: 999;
}
23 changes: 14 additions & 9 deletions src/game/scenes/system/system.ts
Original file line number Diff line number Diff line change
@@ -8,23 +8,26 @@ import { MenuPage } from '~type/menu';

export class System extends Scene {
constructor() {
super({
key: GameScene.SYSTEM,
pack: getAssetsPack(),
});

setLoadingStatus('ASSETS LOADING');
super(GameScene.SYSTEM);
}

public async create() {
await this.game.loadPayload();
public async preload() {
this.load.on('progress', (value: number) => {
setLoadingStatus(`LOADING\n${Math.round(value * 100)}%`);
});

this.load.addPack([getAssetsPack()]);

await Promise.all([
loadFontFace(InterfaceFont.PIXEL_LABEL, 'pixel_label.ttf'),
loadFontFace(InterfaceFont.PIXEL_TEXT, 'pixel_text.ttf'),
]);
}

removeLoading();
public async create() {
setLoadingStatus('LOADING\nDONE');

await this.game.loadPayload();

this.scene.launch(GameScene.WORLD);
this.scene.launch(GameScene.MENU, {
@@ -33,6 +36,8 @@ export class System extends Scene {

this.scene.bringToTop();

removeLoading();

this.input.keyboard?.on(CONTROL_KEY.PAUSE, () => {
if (this.game.isPaused) {
// System pause
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
<body>
<div class="system-overlay" id="loading">
<div class="loading-animation"></div>
<div id="loading-status">GAME LOADING</div>
<div id="loading-status">PREPARING</div>
</div>
<div id="game-container"></div>
</body>