Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
74f09f6
v0.0.18
ash-r1 Dec 9, 2020
6d94607
Add react & react-pixi, config for tsx
ash-r1 Dec 13, 2020
6c49e07
Remove PIXI from exports, it should be used just as external library
ash-r1 Dec 13, 2020
0a9fd0a
Add deadly simple GameLayer for React-based rendering
ash-r1 Dec 13, 2020
00b3428
Add redux
ash-r1 Dec 14, 2020
24f27ef
Basic support for redux, a redux store must be passed by users' program.
ash-r1 Dec 16, 2020
e0f8718
Bit fix for exporting
ash-r1 Dec 16, 2020
dcfcd84
disable eslint prop-types
ash-r1 Dec 16, 2020
22d0227
Add World layer to manage game scene
ash-r1 Dec 30, 2020
e60448a
add & setup redux saga
ash-r1 Dec 30, 2020
d80989d
Basic implementation of redux based game sequence
ash-r1 Dec 31, 2020
4c8938f
Add bg/fg/msg/acc layers
ash-r1 Jan 1, 2021
0094438
World layer component can set by outside of VN.js
ash-r1 Jan 1, 2021
c3d7f39
World has Character component by default
ash-r1 Jan 1, 2021
7743728
Blink Character
ash-r1 Jan 1, 2021
98de15a
Set name for containers & wrap with container for each layergroups (b…
ash-r1 Jan 11, 2021
a768550
Set name for Character layer
ash-r1 Jan 11, 2021
860c620
Rename internal API's "name" instead of "key" for layer name
ash-r1 Jan 11, 2021
90a52ca
upgrade pixi.js
ash-r1 Jan 12, 2021
a15c8ea
[WIP] Show character basic by character.show redux action
ash-r1 Jan 12, 2021
883edb1
Show character with crossfade & blink
ash-r1 Jan 12, 2021
0403827
Remove old implementation
ash-r1 Jan 16, 2021
65956b2
Share PIXI.Application & worldContainer via VN.js context
ash-r1 Jan 23, 2021
242c31f
Add Engine abstraction layer instead of Context.
ash-r1 Jan 24, 2021
e30f0c5
[WIP] .vs script-based scenario object
ash-r1 Jan 24, 2021
3199cf8
Character show/hide command
ash-r1 Jan 24, 2021
32a232d
Add wait flag to command
ash-r1 Jan 29, 2021
8ecfd43
Do next command automatically unless wait property set to true.
ash-r1 Jan 29, 2021
56a3ca5
scenario jump feature
ash-r1 Jan 31, 2021
29c8154
Jump to label
ash-r1 Jan 31, 2021
d59ff92
Show message basics
ash-r1 Feb 28, 2021
a71ccfe
TextStyle options
ash-r1 Feb 28, 2021
dec6761
hide message layer
ash-r1 Feb 28, 2021
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
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier',
'prettier/@typescript-eslint',
],
Expand All @@ -35,7 +36,7 @@ module.exports = {
{
groups: [
// pixi.js first
['^pixi.js'],
['^react$', '^pixi.js', '^@inlet/react-pixi$'],
// Side effect imports.
['^\\u0000'],
// Packages.
Expand All @@ -61,5 +62,6 @@ module.exports = {
ignoreRestSiblings: true,
},
],
'react/prop-types': 'off',
},
};
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ash-r1/vn.js",
"version": "0.0.17",
"version": "0.1.0-alpha.0",
"repository": "git@github.com:ash-r1/VN.js.git",
"author": "Ash <ash.suzuki.r1@gmail.com>",
"license": "MPL-2.0",
Expand Down Expand Up @@ -29,6 +29,8 @@
"types"
],
"dependencies": {
"@inlet/react-pixi": "^6.0.6",
"@reduxjs/toolkit": "^1.5.0",
"chalk": "^4.1.0",
"change-case": "^4.1.1",
"chokidar": "^3.4.2",
Expand All @@ -40,6 +42,11 @@
"pixi-sound": "^3.0.5",
"pixi.js": "^5.3.3",
"raw-loader": "^4.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-saga": "^1.1.3",
"watch": "^1.0.2"
},
"devDependencies": {
Expand All @@ -54,12 +61,15 @@
"@types/fontfaceobserver": "^0.0.6",
"@types/jest": "^26.0.13",
"@types/parsimmon": "^1.10.2",
"@types/react": "^17.0.0",
"@types/react-redux": "^7.1.12",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"babel-jest": "^26.3.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-simple-import-sort": "^5.0.3",
"jest": "^26.4.2",
"prettier": "^2.0.5",
Expand Down
41 changes: 41 additions & 0 deletions src/engine/BaseEngine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as PIXI from 'pixi.js';

import Control from './modules/control';
import Image from './modules/image';
import Message from './modules/message';
import { Scenarios } from './scenario';
import ScenarioController from './scenario/ScenarioController';

export default abstract class BaseEngine {
app?: PIXI.Application;
worldContainer?: PIXI.Container;
scenarioController: ScenarioController;
_: Control;
image: Image;
message: Message;

constructor(scenarios: Scenarios<BaseEngine>) {
this.scenarioController = new ScenarioController(scenarios);
this.image = new Image();
this.message = new Message('game/textbox.png', {
layout: {
y: 630,
height: 420,
width: 1920,
padding: {
left: 450,
top: 100,
},
},
style: {
fontFamily: 'Noto Serif JP',
fill: '#1e1e1e',
align: 'left',
fontSize: 36,
fontWeight: '500',
lineHeight: 50,
},
});
this._ = new Control();
}
}
99 changes: 0 additions & 99 deletions src/engine/BaseGame.ts

This file was deleted.

50 changes: 50 additions & 0 deletions src/engine/GameLayer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import { Container, Stage } from '@inlet/react-pixi';

import { Provider } from 'react-redux';

import { BaseStore } from '../redux';
import BaseEngine from './BaseEngine';
import World from './components/World';
import { EngineProvider } from './provider';

interface Props {
// TOOD: Config here?
width: number;
height: number;
components?: Record<string, React.ComponentType<any>>;
}

// TODO: 外から渡したパラメータを元にstoreをextend出来ること
// もしくはProviderで包むのはゲーム側の責務にする(事もできる)ようにすること? 単にpropsでStore渡して、その型を型推論するようにしてもいいかもしれない。
export const Game: React.FC<Props> = (props) => {
return (
<Container name="game">
<World {...props} />
</Container>
);
};

interface GameProps extends Props {
store: BaseStore;
engine: BaseEngine;
}

const GameLayer: React.FC<GameProps> = (props) => {
const { store, width, height, engine, ...others } = props;
return (
<Stage
width={width}
height={height}
options={{ antialias: true, autoDensity: true }}
>
<EngineProvider value={engine}>
<Provider store={store}>
<Game width={width} height={height} {...others} />
</Provider>
</EngineProvider>
</Stage>
);
};

export default GameLayer;
90 changes: 0 additions & 90 deletions src/engine/Runner.ts

This file was deleted.

Loading