Skip to content

Commit 7df3eaa

Browse files
authored
Merge pull request #22 from EndoHizumi/develop
0.2.10
2 parents 7dfb1fd + 2e13c2c commit 7df3eaa

8 files changed

Lines changed: 29 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ webTaleKitは、現在アルファ版です。
168168
- メソッドの呼び出し
169169
- 式の実行
170170
- 変数の定義・値の変更
171+
- JavaScript側での背景画像の変更
172+
- TypeScript連携
171173
- REST API呼び出し(レスポンスの表示)
172174

173175
## アルファ版(0.1.x-0.2.x)の制限事項

example/engineConfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"title": "EXAMPLE GAME",
3+
"description": "webTaleKit Example Game",
4+
"resolution": {
5+
"width": 1280,
6+
"height": 720
7+
},
8+
"fullScreen": "false",
9+
"url": ""
10+
}

example/src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Core } from 'webtalekit/src/core/'
1+
import { Core } from 'webtalekit-alpha/src/core/'
2+
import engineConfig from '../engineConfig.json'
23

34
const game = new Core()
45

@@ -8,5 +9,5 @@ const sceneParam = urlParams.get('scene')
89

910
// 指定されたシーンがある場合はそのシーンを、なければタイトルシーンを開始
1011
const initialScene = sceneParam || 'title'
11-
12+
game.setConfig(engineConfig)
1213
game.start(initialScene)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "webtalekit",
3-
"version": "0.2.8",
2+
"name": "webtalekit-alpha",
3+
"version": "0.2.10",
44
"description": "Web知識でノベルゲーを作ることを目指したやつ",
55
"main": "./src/index.js",
66
"scripts": {
77
"lint": "eslint . --ext .ts --ext .js",
88
"test": "jest",
9-
"build": "rimraf ./dist/ && tsc && cp -r package.json engineConfig.json parser/ dist/ && cp src/core/index.js dist/src/core/"
9+
"build": "rimraf ./dist/ && tsc && cp -r package.json README.md engineConfig.json parser/ dist/ && cp src/core/index.js dist/src/core/"
1010
},
1111
"bin": {
1212
"wtc": "parser/cli.js"

parser/parser.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ module.exports = async (data) => {
4545
if (element.type === 'scenario') {
4646
scenario = flattenAttributes(element.content)
4747
} else {
48-
console.log(element)
4948
script = element.content
50-
lang = element.attributes.type
49+
lang = element.attributes?.type
5150
}
5251
})
5352
return { scenario, script, lang }

src/core/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class Core {
3232
}
3333

3434
constructor() {
35+
// gameContainerの初期化(HTMLのgameContainerを取得する)
3536
this.gameContainer = document.getElementById('gameContainer')
3637
// Drawerの初期化(canvasタグのサイズを設定する)
3738
this.drawer = new Drawer(this.gameContainer)
@@ -43,6 +44,12 @@ export class Core {
4344
this.usedSounds = {}
4445
}
4546

47+
setConfig(config) {
48+
outputLog('call', 'debug', config)
49+
// ゲームの設定情報をセットする
50+
engineConfig = config
51+
}
52+
4653
async start(initScene) {
4754
outputLog('call', 'debug', initScene)
4855
// TODO: ブラウザ用のビルドの場合は、最初にクリックしてもらう
@@ -594,7 +601,6 @@ export class Core {
594601
moveTo: this.drawer.moveTo.bind(this.drawer),
595602
fadeIn: this.drawer.fadeIn.bind(this.drawer),
596603
fadeOut: this.drawer.fadeOut.bind(this.drawer),
597-
rotateCanvas: this.drawer.rotateCanvas.bind(this.drawer),
598604
},
599605
sound: {
600606
play: this.soundHandler.bind(this),

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"forceConsistentCasingInFileNames": true,
44
"strict": true,
5-
"outDir": "./dist/",
5+
"outDir": "./dist/src/",
66
"sourceMap": true,
77
"noImplicitAny": true,
88
"module": "commonjs",

0 commit comments

Comments
 (0)