This commit is contained in:
2024-08-13 23:34:49 +08:00
parent 876a56c8c1
commit 0c2cc741d7
39 changed files with 2935 additions and 2485 deletions

View File

@@ -9,7 +9,7 @@ export const CardType = {
2: "后排",
}
export const CardList={
1:[1011,1021,1031,1041],
1:[1001,1002,1003,1004,1005,1006],
2:[1011,1021,1031,1041,2021,2022,2031,2032],
3:[1011,1021,1031,1041,2021,2022,2031,2032],
4:[1011,1021,1031,1041,2021,2022,2031,2032],
@@ -19,28 +19,28 @@ export const CardList={
export const CardSet = {
1011:{
uuid:1011, name:'叽叽', type:1, level:1,prefab_path:1011,atk:1,atk_cd:0.5, hp:15, power:45, speed:80,
1001:{
uuid:1001, name:'叽叽', type:1, level:1,prefab_path:1001,atk:1,atk_cd:0.5, hp:15, power:45, speed:80,
skill:{ }
},
1021:{
uuid:1021, name:'汪汪', type:1, level:1,prefab_path:1021,atk:2,atk_cd:1, hp:15, power:50, speed:50,
1002:{
uuid:1002, name:'汪汪', type:1, level:1,prefab_path:1002,atk:2,atk_cd:1, hp:15, power:50, speed:50,
skill:{ }
},
1031:{
uuid:1031, name:'喵喵', type:1, level:1,prefab_path:1031,atk:1, atk_cd:0.5, hp:20, power:50, speed:50,
1003:{
uuid:1003, name:'喵喵', type:1, level:1,prefab_path:1003,atk:1, atk_cd:0.5, hp:20, power:50, speed:50,
skill:{ }
},
1041:{
uuid:1041, name:'胖大', type:2, level:1,prefab_path:1041,atk:4,atk_cd:1.5, hp:15, power:50, speed:50,
1004:{
uuid:1004, name:'胖大', type:2, level:1,prefab_path:1004,atk:4,atk_cd:1.5, hp:15, power:50, speed:50,
skill:{ }
},
2021:{
uuid:2021, name:'汪汪[强]', type:1, level:2,prefab_path:2021,atk:6,atk_cd:1, hp:25, power:50, speed:50,
1005:{
uuid:1005, name:'汪汪[强]', type:1, level:2,prefab_path:1005,atk:6,atk_cd:1, hp:25, power:50, speed:50,
skill:{ }
},
2022:{
uuid:2022, name:'沃夫', type:1, level:2,prefab_path:2022,atk:6,atk_cd:1, hp:30, power:50, speed:50,
1006:{
uuid:1006, name:'沃夫', type:1, level:2,prefab_path:1006,atk:6,atk_cd:1, hp:30, power:50, speed:50,
skill:{ }
},
2031:{

View File

@@ -48,11 +48,11 @@ export class Hero extends ecs.Entity {
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
const url = 'game/heros/hero/heros';
const url = 'game/heros/heros';
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].prefab_path);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].uuid);
});
this.hero_init(uuid,node)
oops.message.dispatchEvent("hero_load",this)

View File

@@ -34,17 +34,17 @@ export class HeroCard extends ecs.Entity {
load(pos: Vec3 = Vec3.ZERO,uuid:number=1001,parent:Node) {
// console.log("load hero",uuid);
// var path = "game/monster/"+prefab_path;
var path = "game/heros/cards/hero_card";
var path = "game/heros/hero_card";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = parent;
// node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
const url = 'game/heros/hero/heros';
const url = 'game/heros/heros';
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = node.getChildByName("hero").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].prefab_path);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].uuid);
});
var hcv = node.getComponent(HeroCardViewComp)!;

View File

@@ -48,11 +48,11 @@ export class Monster extends ecs.Entity {
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
const url = 'game/heros/hero/heros';
const url = 'game/heros/heros';
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].prefab_path);
sprite.spriteFrame = atlas.getSpriteFrame(CardSet[uuid].uuid);
});
this.hero_init(uuid,node)
oops.message.dispatchEvent("monster_load",this)