-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from AllanCerveaux/develop
Try GithubAction and fix some bug
- Loading branch information
Showing
20 changed files
with
303 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '20' | ||
- name: Install Dependencies | ||
run: npm i | ||
- name: Build | ||
run: npm run build | ||
- name: Deploy to GH-Pages | ||
uses: JamesIves/github-pages-deploy-action@v4.5.0 | ||
with: | ||
branch: gh-pages | ||
folder: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"name": "Development Server - Browser Debug", | ||
"url": "http://localhost:3000", | ||
"webRoot": "${workspaceFolder}", | ||
"preLaunchTask": "Development Server - Start", | ||
"postDebugTask": "Development Server - Stop" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Development Server - Start", | ||
"type": "shell", | ||
"command": "pnpm start", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
// There's no better way to run the browser after tasks | ||
// @TODO: Need refacto maybe | ||
"owner": "custom", | ||
"pattern": { | ||
"regexp": ".*", | ||
"file": 1, | ||
"location": 2, | ||
"message": 3 | ||
}, | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": ".*VITE.*", | ||
"endsPattern": ".*ready in.*ms" | ||
} | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "shared", | ||
} | ||
}, | ||
{ | ||
"label": "Development Server - Stop", | ||
"type": "shell", | ||
"command": "kill $(lsof -t -i:3000)", | ||
"problemMatcher": [], | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
}, | ||
"private": true, | ||
"volta": { | ||
"node": "20.11.0" | ||
"node": "20.11.1", | ||
"pnpm": "8.15.3" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as EssentialsPlugin from '@tweakpane/plugin-essentials' | ||
|
||
import { Pane } from 'tweakpane' | ||
import { PlayerBase } from '../../player/PlayerBase' | ||
import { PlayerPanel } from './player.panel' | ||
|
||
export function DebugGUI(scene: Phaser.Scene, player: PlayerBase) { | ||
const pane = new Pane({ | ||
title: 'Procedural Dungeon Debug', | ||
}) | ||
pane.registerPlugin(EssentialsPlugin) | ||
|
||
const game_folder = pane.addFolder({ | ||
title: 'Game', | ||
expanded: false, | ||
}) | ||
|
||
game_folder.addBinding(scene.game.loop, 'actualFps', { | ||
readonly: true, | ||
label: 'FPS', | ||
view: 'graph', | ||
min: 0, | ||
max: 120, | ||
}) | ||
|
||
PlayerPanel(pane, player) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import { Life } from '@game/objects/base/Life' | ||
import { StatisticBase } from '@game/objects/base/Statistics' | ||
import { PlayerBase } from '@game/objects/player/PlayerBase' | ||
import { PLAYER_EMITTER } from '@game/objects/player/type' | ||
import { PlayerEmitter } from '@game/utils/events' | ||
import type { FolderApi, Pane } from 'tweakpane' | ||
|
||
const DEFAULT_NUMBER_DISPLAYER_CONFIG = { | ||
readonly: true, | ||
format: (value: number) => value.toFixed(0), | ||
} | ||
|
||
export function PlayerPanel(panel: Pane, player: PlayerBase) { | ||
const playerFolder = panel.addFolder({ | ||
title: 'Player', | ||
expanded: false, | ||
}) | ||
|
||
playerFolder.addBinding(player.body, 'speed', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
label: 'Body Speed', | ||
}) | ||
|
||
PlayerPanelStatistic(playerFolder, player._statistics) | ||
PlayerPanelLife(playerFolder, player._life) | ||
} | ||
|
||
function PlayerPanelStatistic(playerFolder: FolderApi, statistics: StatisticBase) { | ||
const statisticFolder = playerFolder.addFolder({ | ||
title: 'Statistics', | ||
expanded: false, | ||
}) | ||
|
||
statisticFolder.addBinding(statistics, 'attack_distance', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
statisticFolder.addBinding(statistics, 'attack_speed', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
statisticFolder.addBinding(statistics, 'luck', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
statisticFolder.addBinding(statistics, 'speed', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
statisticFolder.addBinding(statistics, 'strength', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
} | ||
|
||
function PlayerPanelLife(playerFolder: FolderApi, life: Life) { | ||
const lifeFolder = playerFolder.addFolder({ | ||
title: 'Life controller', | ||
expanded: false, | ||
}) | ||
|
||
lifeFolder.addBinding(life, 'max_total', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
lifeFolder.addBinding(life, 'heart', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
lifeFolder.addBinding(life, 'extra', { | ||
...DEFAULT_NUMBER_DISPLAYER_CONFIG, | ||
}) | ||
|
||
const add_remove = [ | ||
['+1 H', '-1 H'], | ||
['+1 E', '-1 E'], | ||
] | ||
|
||
lifeFolder | ||
.addBlade({ | ||
view: 'buttongrid', | ||
size: [2, 2], | ||
cells: (x: number, y: number) => ({ | ||
title: add_remove[x][y], | ||
}), | ||
label: 'Health', | ||
}) | ||
.on('click', ({ index }: { index: [number, number] }) => { | ||
const [x, y] = index | ||
if (x === 0 && y === 0) PlayerEmitter.emit(PLAYER_EMITTER.HEALTH_UP, 'heart') | ||
if (x === 0 && y === 1) PlayerEmitter.emit(PLAYER_EMITTER.HEALTH_DOWN, 'heart') | ||
if (x === 1 && y === 0) PlayerEmitter.emit(PLAYER_EMITTER.HEALTH_UP, 'extra') | ||
if (x === 1 && y === 1) PlayerEmitter.emit(PLAYER_EMITTER.HEALTH_DOWN, 'extra') | ||
}) | ||
|
||
lifeFolder | ||
.addBlade({ | ||
view: 'buttongrid', | ||
size: [2, 2], | ||
cells: (x: number, y: number) => ({ | ||
title: add_remove[x][y], | ||
}), | ||
label: 'Heal\nDamage', | ||
}) | ||
.on('click', ({ index }: { index: [number, number] }) => { | ||
const [x, y] = index | ||
if (x === 0 && y === 0) PlayerEmitter.emit(PLAYER_EMITTER.HEAL, 'heart', 1) | ||
if (x === 0 && y === 1) PlayerEmitter.emit(PLAYER_EMITTER.DAMAGE, 'heart', 1) | ||
if (x === 1 && y === 0) PlayerEmitter.emit(PLAYER_EMITTER.HEAL, 'extra', 1) | ||
if (x === 1 && y === 1) PlayerEmitter.emit(PLAYER_EMITTER.DAMAGE, 'extra', 1) | ||
}) | ||
} |
Oops, something went wrong.