mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
更新无限地图
This commit is contained in:
@@ -9,6 +9,12 @@ import { _decorator } from "cc";
|
||||
import { instantiate } from "cc";
|
||||
import { GPVPModePlayerEnum } from "./GPVPMode";
|
||||
import { JNFrameInfo } from "../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
|
||||
import { GMapLoop } from "../base/common/map/GMapLoop";
|
||||
import { Node } from "cc";
|
||||
import JNFrameTime from "../../../../extensions/ngame/assets/ngame/sync/frame/game/time/JNFrameTime";
|
||||
import { TableGMap } from "../../../resources/config/ts/TableGMap";
|
||||
import { app } from "../../App";
|
||||
import { v3 } from "cc";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -34,6 +40,21 @@ export default class GOnHookMode extends GBaseMode<{}>{
|
||||
|
||||
@property(Prefab)
|
||||
rolePrefab: Prefab = null;
|
||||
|
||||
//场景地图
|
||||
@property(GMapLoop)
|
||||
map1:GMapLoop;
|
||||
@property(GMapLoop)
|
||||
map2:GMapLoop;
|
||||
@property(GMapLoop)
|
||||
map3:GMapLoop;
|
||||
|
||||
@property(Node)
|
||||
objects: Node = null;
|
||||
|
||||
get scene():Node{
|
||||
return this.objects;
|
||||
}
|
||||
|
||||
//玩家信息
|
||||
playerInfo:GOnHookInfo;
|
||||
@@ -49,12 +70,30 @@ export default class GOnHookMode extends GBaseMode<{}>{
|
||||
playerRoles: GRoleDefault[] = [];
|
||||
//敌方宠物
|
||||
enemyRoles: GRoleDefault[] = [];
|
||||
|
||||
offsetX:number = 0;
|
||||
|
||||
//地图信息
|
||||
mapInfo:TableGMap;
|
||||
|
||||
onSyncInitSuccess():void{
|
||||
|
||||
//初始化战斗
|
||||
console.log("GOnHookMode 模式初始化");
|
||||
|
||||
//调整相机
|
||||
let camreaPos = this.camera.node.worldPosition;
|
||||
this.camera.node.worldPosition = v3(0,100,camreaPos.z)
|
||||
|
||||
//初始化地图
|
||||
this.mapInfo = TableGMap.getConfig(60001);
|
||||
this.map1.init(app.battleRes.maps[60001][0],1);
|
||||
this.map1.UpdateMap(0,this.camera.node.worldPosition.x,this.mapInfo.map1OffsetY);
|
||||
this.map2.init(app.battleRes.maps[60001][1],1);
|
||||
this.map2.UpdateMap(0,this.camera.node.worldPosition.x,this.mapInfo.map2OffsetY);
|
||||
this.map3.init(app.battleRes.maps[60001][2],1,app.battleRes.maps[60001][1].width,app.battleRes.maps[60001][1].height);
|
||||
this.map3.UpdateMap(0,this.camera.node.worldPosition.x,this.mapInfo.map3OffsetY);
|
||||
|
||||
this.playerInfo = { tactical: GTactical.getTactical().setOffset(this.playerPos), roles: GRoleUtil.getGRoles([10004,10004,10004,10004,10003,10003]) };
|
||||
this.enemyInfo = { tactical: GTactical.getTactical(true).setOffset(this.enemyPos), roles: GRoleUtil.getGRoles([10002]) };
|
||||
|
||||
@@ -67,8 +106,6 @@ export default class GOnHookMode extends GBaseMode<{}>{
|
||||
|
||||
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: {}){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//生成宠物
|
||||
@@ -139,6 +176,11 @@ export default class GOnHookMode extends GBaseMode<{}>{
|
||||
|
||||
//角色死亡回调
|
||||
onRoleKillBack(role:GRoleDefault){
|
||||
//死亡销毁
|
||||
JNFrameTime.getInstance().setTimeout(() => {
|
||||
if(role.isValid)
|
||||
role.node.destroy()
|
||||
},3000)
|
||||
//如果没有敌人则生成敌人
|
||||
if(this.getOnesRole(GOnHookModePlayerEnum.ENEMY).filter(role => !!role.get()).length <= 0){
|
||||
//生成敌人
|
||||
|
Reference in New Issue
Block a user