mirror of
https://github.com/motajs/template.git
synced 2026-11-02 15:04:30 +08:00
chore: 注释调整与接口微调
This commit is contained in:
1 parent
79d06c31df
commit
ebfe59b4f5
8 files changed
+64
-8
No files matched your search
@@ -68,8 +68,8 @@ export class CoreState implements ICoreState {
|
||||
// 怪物上下文初始化
|
||||
const enemyContext = new EnemyContext<IEnemyAttr, IHeroAttr>();
|
||||
const damageSystem = new DamageSystem(enemyContext);
|
||||
damageSystem.useCalculator(new MainDamageCalculator());
|
||||
const mapDamage = new MapDamage(enemyContext);
|
||||
damageSystem.useCalculator(new MainDamageCalculator());
|
||||
mapDamage.useConverter(new MainMapDamageConverter());
|
||||
mapDamage.useReducer(new MainMapDamageReducer());
|
||||
enemyContext.attachDamageSystem(damageSystem);
|
||||
|
||||
@@ -2,12 +2,14 @@ import { loading } from '@user/data-base';
|
||||
import { CoreState } from './core';
|
||||
import { isNil } from 'lodash-es';
|
||||
import { FaceDirection } from './common';
|
||||
import { ICoreState } from './types';
|
||||
import { TILE_HEIGHT, TILE_WIDTH } from './shared';
|
||||
|
||||
function createCoreState() {
|
||||
function createCoreState(state: ICoreState) {
|
||||
//#region 地图部分
|
||||
|
||||
const width = core._WIDTH_;
|
||||
const height = core._HEIGHT_;
|
||||
const width = TILE_WIDTH;
|
||||
const height = TILE_HEIGHT;
|
||||
const bg = state.layer.addLayer(width, height);
|
||||
const bg2 = state.layer.addLayer(width, height);
|
||||
const event = state.layer.addLayer(width, height);
|
||||
@@ -56,7 +58,7 @@ function createCoreState() {
|
||||
export function create() {
|
||||
loading.once('loaded', () => {
|
||||
// 加载后初始化全局状态
|
||||
createCoreState();
|
||||
createCoreState(state);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user