diff --git a/assets/resources/game/map/map_rpg.prefab b/assets/resources/game/map/map_rpg.prefab index 2b5828b1..0e10e144 100644 --- a/assets/resources/game/map/map_rpg.prefab +++ b/assets/resources/game/map/map_rpg.prefab @@ -601,13 +601,13 @@ "_restitution": 0, "_offset": { "__type__": "cc.Vec2", - "x": 0, - "y": -386.5 + "x": 1.9, + "y": -400.1 }, "_size": { "__type__": "cc.Size", - "width": 3182.4, - "height": 827 + "width": 3178.5, + "height": 799.8 }, "_id": "" }, @@ -624,8 +624,6 @@ "__id__": 0 }, "fileId": "9eQ9Op13lL5ZqF+H2E1cEl", - "instance": null, - "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { diff --git a/assets/resources/game/skills/atk1/atk.plist b/assets/resources/game/skills/atk1/atk.plist index f4bbfc79..977171a6 100644 --- a/assets/resources/game/skills/atk1/atk.plist +++ b/assets/resources/game/skills/atk1/atk.plist @@ -15,9 +15,9 @@ spriteSourceSize {96,96} textureRect - {{96,1},{80,96}} + {{1,678},{80,96}} textureRotated - + atk1_07.png @@ -30,9 +30,69 @@ spriteSourceSize {96,93} textureRect - {{1,1},{96,93}} + {{1,583},{96,93}} textureRotated - + + + guard_trailing_0-12.png + + aliases + + spriteOffset + {0,0} + spriteSize + {97,143} + spriteSourceSize + {97,143} + textureRect + {{1,295},{97,143}} + textureRotated + + + guard_trailing_0-17.png + + aliases + + spriteOffset + {0,0} + spriteSize + {98,141} + spriteSourceSize + {98,141} + textureRect + {{1,1},{98,141}} + textureRotated + + + guard_trailing_0-18.png + + aliases + + spriteOffset + {0,0} + spriteSize + {97,141} + spriteSourceSize + {97,141} + textureRect + {{1,440},{97,141}} + textureRotated + + + guard_trailing_0-8.png + + aliases + + spriteOffset + {0,0} + spriteSize + {97,149} + spriteSourceSize + {97,149} + textureRect + {{1,144},{97,149}} + textureRotated + metadata @@ -46,9 +106,9 @@ realTextureFileName atk.png size - {177,98} + {100,759} smartupdate - $TexturePacker:SmartUpdate:921ca90a772281d8370d52dcd03d69bb:e98751142a1edb6198b7f9d055c0661a:161bb8e8e5d13d624c660b9bcb3183a7$ + $TexturePacker:SmartUpdate:dedc4bfaabc2009a0f55fa94882d533b:ccd331208d7352b4c4126d7e1102f82e:161bb8e8e5d13d624c660b9bcb3183a7$ textureFileName atk.png diff --git a/assets/resources/game/skills/atk1/atk.plist.meta b/assets/resources/game/skills/atk1/atk.plist.meta index df3daf2f..9d252d6c 100644 --- a/assets/resources/game/skills/atk1/atk.plist.meta +++ b/assets/resources/game/skills/atk1/atk.plist.meta @@ -7,6 +7,52 @@ ".json" ], "subMetas": { + "85462": { + "importer": "sprite-frame", + "uuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a@85462", + "displayName": "", + "id": "85462", + "name": "guard_trailing_0-18", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 1, + "trimY": 440, + "width": 97, + "height": 141, + "rawWidth": 97, + "rawHeight": 141, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [], + "indexes": [], + "uv": [], + "nuv": [], + "minPos": [], + "maxPos": [] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "080612ff-048b-45e7-b7d1-383a7fa73063@6c48a", + "atlasUuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, "41d52": { "importer": "sprite-frame", "uuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a@41d52", @@ -16,11 +62,11 @@ "userData": { "trimType": "auto", "trimThreshold": 1, - "rotated": false, + "rotated": true, "offsetX": 0, "offsetY": 0, - "trimX": 96, - "trimY": 1, + "trimX": 1, + "trimY": 678, "width": 80, "height": 96, "rawWidth": 96, @@ -62,11 +108,11 @@ "userData": { "trimType": "auto", "trimThreshold": 1, - "rotated": true, + "rotated": false, "offsetX": 0, "offsetY": 0, "trimX": 1, - "trimY": 1, + "trimY": 583, "width": 96, "height": 93, "rawWidth": 96, @@ -98,6 +144,144 @@ ".json" ], "subMetas": {} + }, + "5e00d": { + "importer": "sprite-frame", + "uuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a@5e00d", + "displayName": "", + "id": "5e00d", + "name": "guard_trailing_0-12", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 1, + "trimY": 295, + "width": 97, + "height": 143, + "rawWidth": 97, + "rawHeight": 143, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [], + "indexes": [], + "uv": [], + "nuv": [], + "minPos": [], + "maxPos": [] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "080612ff-048b-45e7-b7d1-383a7fa73063@6c48a", + "atlasUuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, + "1573b": { + "importer": "sprite-frame", + "uuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a@1573b", + "displayName": "", + "id": "1573b", + "name": "guard_trailing_0-17", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 1, + "trimY": 1, + "width": 98, + "height": 141, + "rawWidth": 98, + "rawHeight": 141, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [], + "indexes": [], + "uv": [], + "nuv": [], + "minPos": [], + "maxPos": [] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "080612ff-048b-45e7-b7d1-383a7fa73063@6c48a", + "atlasUuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} + }, + "104fb": { + "importer": "sprite-frame", + "uuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a@104fb", + "displayName": "", + "id": "104fb", + "name": "guard_trailing_0-8", + "userData": { + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 1, + "trimY": 144, + "width": 97, + "height": 149, + "rawWidth": 97, + "rawHeight": 149, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "packable": true, + "pixelsToUnit": 100, + "pivotX": 0.5, + "pivotY": 0.5, + "meshType": 0, + "vertices": { + "rawPosition": [], + "indexes": [], + "uv": [], + "nuv": [], + "minPos": [], + "maxPos": [] + }, + "isUuid": true, + "imageUuidOrDatabaseUri": "080612ff-048b-45e7-b7d1-383a7fa73063@6c48a", + "atlasUuid": "2e21a159-09af-47d0-b8f3-92f814f4a38a" + }, + "ver": "1.0.12", + "imported": true, + "files": [ + ".json" + ], + "subMetas": {} } }, "userData": { diff --git a/assets/resources/game/skills/atk1/atk.png b/assets/resources/game/skills/atk1/atk.png index 285a1065..c0266677 100644 Binary files a/assets/resources/game/skills/atk1/atk.png and b/assets/resources/game/skills/atk1/atk.png differ diff --git a/assets/resources/game/skills/base.prefab b/assets/resources/game/skills/base.prefab index 59f0c3ad..64c90e86 100644 --- a/assets/resources/game/skills/base.prefab +++ b/assets/resources/game/skills/base.prefab @@ -108,8 +108,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": -0.5, + "y": 0.5, "z": 1 }, "_mobility": 0, @@ -136,8 +136,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 80, - "height": 96 + "width": 97, + "height": 143 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -173,7 +173,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "2e21a159-09af-47d0-b8f3-92f814f4a38a@41d52", + "__uuid__": "2e21a159-09af-47d0-b8f3-92f814f4a38a@5e00d", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, @@ -188,7 +188,10 @@ "_fillRange": 0, "_isTrimmedMode": true, "_useGrayscale": false, - "_atlas": null, + "_atlas": { + "__uuid__": "2e21a159-09af-47d0-b8f3-92f814f4a38a", + "__expectedType__": "cc.SpriteAtlas" + }, "_id": "" }, { diff --git a/assets/resources/game/skills/base2.prefab b/assets/resources/game/skills/base2.prefab index dcbd0e0f..01462a7e 100644 --- a/assets/resources/game/skills/base2.prefab +++ b/assets/resources/game/skills/base2.prefab @@ -108,8 +108,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1, - "y": 1, + "x": -0.5, + "y": 0.5, "z": 1 }, "_mobility": 0, @@ -136,8 +136,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 96, - "height": 93 + "width": 97, + "height": 149 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -173,7 +173,7 @@ "a": 255 }, "_spriteFrame": { - "__uuid__": "2e21a159-09af-47d0-b8f3-92f814f4a38a@b3fb8", + "__uuid__": "2e21a159-09af-47d0-b8f3-92f814f4a38a@104fb", "__expectedType__": "cc.SpriteFrame" }, "_type": 0, diff --git a/assets/script/game/Role/Role.ts b/assets/script/game/Role/Role.ts index 11fcdb91..9d673a21 100644 --- a/assets/script/game/Role/Role.ts +++ b/assets/script/game/Role/Role.ts @@ -34,17 +34,16 @@ export class Role extends ecs.Entity { } /** 加载角色 */ - load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=101) { + load(uuid:number=101) { // var path = "game/monster/"+prefab_path; var path = "game/heros/role"; - + let pos: Vec3 = Vec3.ZERO var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); var scene = smc.map.MapView.scene; node.parent = scene.entityLayer!.node!; // var as = node.getComponent(MonsterSpine); - node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, 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/player'; @@ -59,7 +58,7 @@ export class Role extends ecs.Entity { hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){ var rv = node.getComponent(RoleViewComp)!; - + this.add(rv); } diff --git a/assets/script/game/map/view/MapViewComp.ts b/assets/script/game/map/view/MapViewComp.ts index 51edbc1c..468e369d 100644 --- a/assets/script/game/map/view/MapViewComp.ts +++ b/assets/script/game/map/view/MapViewComp.ts @@ -43,7 +43,7 @@ export class MapViewComp extends CCComp { } load_role(){ let role = ecs.getEntity(Role); - role.load() + role.load(103) } load_data(){ // let heros = oops.res.get("config/game/heros") diff --git a/assets/script/game/monster/MonsterViewComp.ts b/assets/script/game/monster/MonsterViewComp.ts index 2c040e08..6bc2f69e 100644 --- a/assets/script/game/monster/MonsterViewComp.ts +++ b/assets/script/game/monster/MonsterViewComp.ts @@ -123,11 +123,9 @@ export class MonsterViewComp extends CCComp { } onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE){ + if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){ this.is_atking = true; - if(otherCollider.tag != BoxSet.SKILL_TAG&&selfCollider.tag != BoxSet.ATK_RANGE){ - this.stop_cd = 0.1; - } + this.stop_cd = 0.1; } } @@ -213,8 +211,8 @@ export class MonsterViewComp extends CCComp { shoot(skill_uuid:number){ // console.log("monster shoot"); let skill = ecs.getEntity(Skill); - let x=0 - let pos = v3(x,40) + let x=32 + let pos = v3(this.scale*32,30) let speed =SkillSet[skill_uuid].speed; let scale = this.scale let dis = SkillSet[skill_uuid].dis; diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index e3c54ea9..e631e255 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -37,7 +37,8 @@ export class SkillCom extends CCComp { collider.tag = this.box_tag; collider.sensor = true; if (collider) { - collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); + collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); + // collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); } if(this.t_pos){ @@ -66,9 +67,9 @@ export class SkillCom extends CCComp { } } - onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - if(otherCollider.group != selfCollider.group){ - // console.log("skill end contact",selfCollider.group,otherCollider.group) + onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + if(otherCollider.group != selfCollider.group&&otherCollider.tag !=BoxSet.ATK_RANGE&&otherCollider.tag !=BoxSet.SKILL_TAG){ + // console.log("skill onBeginContact",selfCollider.group,otherCollider.group) this.is_destroy=true } }