继续游戏模式改变,不再是原先的肉鸽单局,而是闯关轻成长

This commit is contained in:
2025-08-11 17:07:28 +08:00
parent 7bece884da
commit 89daacba36
16 changed files with 12627 additions and 8065 deletions

View File

@@ -21,18 +21,18 @@ export class SingletonModuleComp extends ecs.Comp {
in_select:false,
score:888,
};
fight_heros=[]
mheros:any = [];
fight_heros={
0:0,
1:0,
2:0,
3:0,
4:0,
}
heros:any = [];
monsters:any = [];
sk_info:any = []
monsters_dead:any = []
heros_dead:any = []
hero_pos:any=[]
enemy_pos:any =[]
hero_front_x:number = 0;
hero_back_x:number = 0;
mon_front_x:number = 0;
mon_back_x:number = 0;
enhancements:any=[]
vmdata: any = {
game_over:false,

View File

@@ -0,0 +1,35 @@
import { _decorator, Animation, AnimationClip, CCInteger, Component, Node, resources } from 'cc';
import { smc } from '../common/SingletonModuleComp';
import { HeroInfo } from '../common/config/heroSet';
const { ccclass, property } = _decorator;
@ccclass('HeroReadyCom')
export class HeroReadyCom extends Component {
@property(CCInteger)
slot: number=0;
start() {
this.update_hero()
}
update(deltaTime: number) {
}
update_hero(){
let hero = smc.fight_heros[this.slot]
if(hero==0){
return
}
let hero_data = HeroInfo[hero]
console.log("[HeroReadyCom]hero_data",smc.fight_heros,hero,smc.fight_heros[this.slot],this.slot,hero_data)
let anm_path=hero_data.path
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
this.node.getChildByName("icon").getComponent(Animation).addClip(clip);
this.node.getChildByName("icon").getComponent(Animation).play("idle");
});
// console.log("[HeroReadyCom]clip",this.node.getChildByName("icon").getComponent(Animation))
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "11781c25-08d5-41fc-af3e-b2dfd46dc5d7",
"files": [],
"subMetas": {},
"userData": {}
}