monster add

This commit is contained in:
2024-07-22 09:47:28 +08:00
parent 064b6bf1ae
commit e3b5f4bd05
31 changed files with 4417 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { smc } from "../../common/SingletonModuleComp";
import { Role } from "../../role/Role";
import { Monster } from "../../monster/monster";
// import MapRoadUtils from "./map/road/MapRoadUtils";
import { MapViewScene } from "./MapViewScene";
import { Timer } from "../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
@@ -49,15 +50,15 @@ export class MapViewComp extends CCComp {
this.scene.node.active = true
// smc.monsters = ['war','magic','heath']
// smc.heros = ['war','magic','heath']
if (smc.heros.length>0){
let hero = ecs.getEntity<Role>(Role);
let x = this.getRandomInt(-300, 0)
hero.load(this.aStarToVec3(x+',60'), false, "magic");
}
// if (smc.heros.length>0){
// let hero = ecs.getEntity<Role>(Role);
// let x = this.getRandomInt(-300, 0)
// hero.load(this.aStarToVec3(x+',60'), false, "magic");
// }
if (smc.monsters.length>0){
let monster = ecs.getEntity<Role>(Role);
let x = this.getRandomInt(0, 300)
monster.load(this.aStarToVec3(x+'60'), true, "magic");
let monster = ecs.getEntity<Monster>(Monster);
let x = this.getRandomInt(-100, 100)
monster.load(this.aStarToVec3(x+',-60'));
}
// smc.own.loadJoystick();