Browse Source

准备修改 ...

芋圆号航母 5 years ago
parent
commit
5f836c69ca

BIN
assets/resources/hud/back.png


+ 1 - 1
assets/resources/check.meta

@@ -1,6 +1,6 @@
 {
   "ver": "1.0.1",
-  "uuid": "54e33076-be6b-4713-80bd-e7705e3ba1f1",
+  "uuid": "591a6abb-4b0b-4a1a-b39b-ee62676c234e",
   "isSubpackage": false,
   "subpackageName": "",
   "subMetas": {}

BIN
assets/resources/music/crash.ogg


+ 6 - 0
assets/resources/music/crash.ogg.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "2.0.0",
+  "uuid": "0e9b9cd3-3326-4884-a1f7-a465da07bfaa",
+  "downloadMode": 0,
+  "subMetas": {}
+}

BIN
assets/resources/music/fail_music.ogg


+ 6 - 0
assets/resources/music/fail_music.ogg.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "2.0.0",
+  "uuid": "382579e6-d259-44fc-91cf-a8b825678177",
+  "downloadMode": 0,
+  "subMetas": {}
+}

BIN
assets/resources/music/start_bgm.ogg


+ 6 - 0
assets/resources/music/start_bgm.ogg.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "2.0.0",
+  "uuid": "52bc1017-3568-4920-8aa5-ec811bd2eafd",
+  "downloadMode": 0,
+  "subMetas": {}
+}

BIN
assets/resources/music/win_music.ogg


+ 6 - 0
assets/resources/music/win_music.ogg.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "2.0.0",
+  "uuid": "2fc3ef7c-544c-494d-a40d-07f584b21dfd",
+  "downloadMode": 0,
+  "subMetas": {}
+}

+ 8 - 6
assets/scenes/mainscene.fire

@@ -41,8 +41,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 0.2667317708333333,
-      "y": 0.2667317708333333,
+      "x": 0.26360677083333334,
+      "y": 0.26360677083333334,
       "z": 1
     },
     "_quat": {
@@ -1505,7 +1505,7 @@
   {
     "__type__": "cc.Node",
     "_name": "left",
-    "_objFlags": 0,
+    "_objFlags": 512,
     "_parent": {
       "__id__": 40
     },
@@ -1987,10 +1987,12 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 31
+    },
     "component": "",
-    "_componentId": "f6424QesBRGCqp7+xEuKfnH",
-    "handler": "friendClicked",
+    "_componentId": "fdb9axYnVZHmIryIbp0aqdt",
+    "handler": "rankClicked",
     "customEventData": ""
   },
   {

+ 216 - 13
assets/scenes/rankscene.fire

@@ -41,8 +41,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 0.2667317708333333,
-      "y": 0.2667317708333333,
+      "x": 0.310546875,
+      "y": 0.310546875,
       "z": 1
     },
     "_quat": {
@@ -69,13 +69,16 @@
       },
       {
         "__id__": 5
+      },
+      {
+        "__id__": 9
       }
     ],
     "_active": true,
     "_level": 0,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 13
       }
     ],
     "_prefab": null,
@@ -195,9 +198,9 @@
     "_clearFlags": 7,
     "_backgroundColor": {
       "__type__": "cc.Color",
-      "r": 16,
-      "g": 167,
-      "b": 88,
+      "r": 255,
+      "g": 226,
+      "b": 224,
       "a": 255
     },
     "_depth": -1,
@@ -207,7 +210,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "ctrl",
+    "_name": "back",
     "_objFlags": 0,
     "_parent": {
       "__id__": 2
@@ -234,8 +237,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 544,
-      "height": 960
+      "width": 646,
+      "height": 337
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -244,14 +247,188 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
+      "x": -187.2,
+      "y": 416,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 0.176,
+      "y": 0.176,
+      "z": 1
+    },
+    "_rotationX": 0,
+    "_rotationY": 0,
+    "_quat": {
+      "__type__": "cc.Quat",
       "x": 0,
       "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "groupIndex": 0,
+    "_id": "c99FFp1BhFXZqfk4rXqB5n"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "_spriteFrame": {
+      "__uuid__": "7f5d3a91-4752-45b1-9392-12a2835af0f9"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_state": 0,
+    "_atlas": null,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_id": "e85KRFSJJBKJ2AgzBxiNkZ"
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 5
+    },
+    "_enabled": true,
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 8
+      }
+    ],
+    "_N$interactable": true,
+    "_N$enableAutoGrayEffect": false,
+    "_N$transition": 3,
+    "transition": 3,
+    "_N$normalColor": {
+      "__type__": "cc.Color",
+      "r": 214,
+      "g": 214,
+      "b": 214,
+      "a": 255
+    },
+    "_N$pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_N$hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_N$normalSprite": null,
+    "_N$pressedSprite": null,
+    "pressedSprite": null,
+    "_N$hoverSprite": null,
+    "hoverSprite": null,
+    "_N$disabledSprite": null,
+    "_N$target": null,
+    "_id": "29cRcboC1G3ISH1ppDQ18Y"
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 9
+    },
+    "component": "",
+    "_componentId": "318bdR/UelGl6Zp2tEBPujR",
+    "handler": "backClicked",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "ctrl",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 1,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 11
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 436,
+      "height": 664
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 26,
+      "y": -7,
       "z": 0
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 0.8,
-      "y": 0.8,
+      "x": 1.1,
+      "y": 1.1,
       "z": 1
     },
     "_rotationX": 0,
@@ -273,7 +450,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_id": "1eH3GdDfBCOY7e8t235uAk"
@@ -283,12 +460,38 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 9
     },
     "_enabled": true,
     "_id": "b5JBO8N8ZLmZj7qFMgQRpV"
   },
   {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "_spriteFrame": null,
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_state": 0,
+    "_atlas": null,
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_id": "69lDEsCnNPFYq1EtCKroXi"
+  },
+  {
     "__type__": "cc.Canvas",
     "_name": "",
     "_objFlags": 0,

+ 4 - 4
assets/scenes/startscene.fire

@@ -41,8 +41,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 0.2667317708333333,
-      "y": 0.2667317708333333,
+      "x": 0.2636555989583333,
+      "y": 0.2636555989583333,
       "z": 1
     },
     "_quat": {
@@ -286,7 +286,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 2,
     "_components": [
       {
@@ -799,7 +799,7 @@
       "__id__": 5
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 2,
     "_components": [
       {

+ 6 - 0
assets/scripts/actions/pat.js

@@ -36,6 +36,12 @@ cc.Class({
         this.schedule(this.patUpdate, 1.0 / 15);
     },
 
+    // 停止
+    stop:function() {
+        this.index = 1;
+        this.unschedule(this.patUpdate);
+    },
+
     patUpdate:function(delay) {
         this.g.clear();
         if (this.index > 7) {

+ 6 - 0
assets/scripts/actions/peel.js

@@ -33,6 +33,12 @@ cc.Class({
         this.schedule(this.peelUpdate, 1.0 / 15);
     },
 
+    // 停止
+    stop:function() {
+        this.index = 1;
+        this.unschedule(this.peelUpdate);
+    },
+
     // 定时器
     peelUpdate:function(delay) {
         this.g.clear();

+ 6 - 0
assets/scripts/actions/serve.js

@@ -36,6 +36,12 @@ cc.Class({
         // this.serve_014();
     },
 
+    // 停止
+    stop:function() {
+        this.index = 1;
+        this.unschedule(this.serveUpdate);
+    },
+
     // 发球的定时器
     serveUpdate:function(delay) {
         if (this.index > 19) {

+ 31 - 31
assets/scripts/balls/ball.js

@@ -46,6 +46,8 @@ cc.Class({
         this.poses = new Array();
         // 记录是否需要撞击的效果
         this.showBump = false;
+        // 速度
+        this.speed = 100.0;
     },
 
     // 初始化子节点
@@ -96,12 +98,12 @@ cc.Class({
         var bezier_01 = [beginPos, cc.v2(-82, 20), dropPos];
         var bezier_02 = [dropPos, cc.v2(-68, 220), endPos];
 
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 300, bezier_01);
         var self = this;
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 300, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_RIVAL_LEFT_PAT);
@@ -128,12 +130,12 @@ cc.Class({
         var bezier_01 = [beginPos, cc.v2(61, 16), dropPos];
         var bezier_02 = [dropPos, cc.v2(40, 289), endPos];
 
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 350, bezier_01);
         var self = this;
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 150, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_RIVAL_RIGHT_PAT);
@@ -160,12 +162,12 @@ cc.Class({
         var bezier_01 = [beginPos, cc.v2(-52, 20), dropPos];
         var bezier_02 = [dropPos, cc.v2(22, 340), endPos];
 
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 400, bezier_01);
         var self = this;
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 150, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_RIVAL_RIGHT_PAT);
@@ -192,12 +194,12 @@ cc.Class({
         var bezier_01 = [beginPos, cc.v2(31, 15), dropPos];
         var bezier_02 = [dropPos, cc.v2(-75, 300), endPos];
 
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 150, bezier_01);
         var self = this;
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 150, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_RIVAL_LEFT_PEEL);
@@ -224,12 +226,12 @@ cc.Class({
         var bezier_01 = [beginPos, cc.v2(180, -20), dropPos];
         var bezier_02 = [dropPos, cc.v2(92, 210), endPos];
 
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 250, bezier_01);
         var self = this;
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 200, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_RIVAL_RIGHT_PAT);
@@ -263,8 +265,8 @@ cc.Class({
         
         // 四条路线
         var move_01 = cc.bezierTo(1.2, bezier_01);
-        var move_02 = cc.bezierTo(0.1, bezier_02);
-        var move_03 = cc.bezierTo(0.1, bezier_03);
+        var move_02 = cc.bezierTo(this.speed / 750, bezier_02);
+        var move_03 = cc.bezierTo(this.speed / 1000, bezier_03);
         var self = this;
         var move_03_end = cc.callFunc(function() {
             self.bump(jumpPos);
@@ -297,13 +299,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(-120, -10), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 300, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 200, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_LEFT_PAT);
@@ -332,13 +334,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(-85, 65), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 250, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 150, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_LEFT_PAT);
@@ -367,13 +369,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(-95, -40), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 400, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 250, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_LEFT_PAT);
@@ -403,13 +405,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(95, -35), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 400, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 250, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_RIGHT_PEEL);
@@ -438,13 +440,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(15, 95), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 200, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 250, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_RIGHT_PAT);
@@ -473,13 +475,13 @@ cc.Class({
         var bezier_02 = [dropPos, cc.v2(15, -20), endPos];
 
         // 第一条路线
-        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 200, bezier_01);
         var self = this;
         // 中间碰到了桌面
         var move_01_end = cc.callFunc(function() {
             self.bump(dropPos);
         });
-        var move_02 = cc.bezierTo(0.75, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 150, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_RIGHT_PAT);
@@ -504,13 +506,12 @@ cc.Class({
         this.head.setPosition(beginPos);
 
         var bezier_01 = [beginPos, cc.v2(-230, 410), centerPos];
-        var move_01 = cc.bezierTo(1, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 180, bezier_01);
         var move_01_end = cc.callFunc(function() {
-            cc.log ("动作 1 结束 ... ");
             this.bump(centerPos);
         }, this);
         var bezier_02 = [centerPos, cc.v2(-125, 40), endPos];
-        var move_02 = cc.bezierTo(1, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 180, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_LEFT_PAT);
@@ -535,13 +536,12 @@ cc.Class({
         this.head.setPosition(beginPos);
 
         var bezier_01 = [beginPos, cc.v2(-270, 440), centerPos];
-        var move_01 = cc.bezierTo(1, bezier_01);
+        var move_01 = cc.bezierTo(this.speed / 180, bezier_01);
         var move_01_end = cc.callFunc(function() {
-            cc.log ("动作 1 结束 ... ");
             this.bump(centerPos);
         }, this);
         var bezier_02 = [centerPos, cc.v2(110, 20), endPos];
-        var move_02 = cc.bezierTo(1, bezier_02);
+        var move_02 = cc.bezierTo(this.speed / 180, bezier_02);
         // 在第二条路线后开始的一段时间,需要通知控制器改变状态
         var delay = cc.delayTime(0.25);
         var change = cc.callFunc(this.changeState, this, this.ballconfig.BALL_STATE_MINE_RIGHT_PEEL);
@@ -562,7 +562,7 @@ cc.Class({
 
     // 更改状态
     changeState:function(node, state) {
-        cc.log ("改变状态 ... " + state);
+        // cc.log ("改变状态 ... " + state);
         if(this.stateCallback != null) {
             this.stateCallback(state);
         }

+ 60 - 14
assets/scripts/ctrls/mainctrl.js

@@ -65,6 +65,7 @@ cc.Class({
         this.gameStart();
     },
 
+
     // 初始化数据
     initValues:function() {
         // 球的状态信息
@@ -80,6 +81,7 @@ cc.Class({
     initListener:function() {
         var self = this;
         this.rival.serveStart = function() {
+            cc.log ("发球了 ... ")
             // self.rivalserve.ballServe();
             self.ball.rivalServer();
             self.ball.ballAction();
@@ -116,6 +118,8 @@ cc.Class({
             } else {
                 cc.log ("来右边 ... ")
                 self.mine.setDir(2);
+
+                
                 if (self.ballstate == self.ballconfig.BALL_STATE_MINE_RIGHT_PAT) {
                     self.ball.ballStop();
                     // 右侧可接
@@ -123,11 +127,18 @@ cc.Class({
                     // 这个里面只有往右的
                     self.ball.minePatRToR_01();
                 } else if (self.ballstate == self.ballconfig.BALL_STATE_MINE_RIGHT_PEEL) {
-                    self.ball.ballStop();
+                    
                     // 右侧可削
                     self.mine.peel.peel();
-                    // 这个里面只有往左的
-                    self.ball.minePeelRToL_01();
+                    self.scheduleOnce (function() {
+                        // 需要保证不是在结束状态
+                        if (!this.isEnd) {
+                            self.ball.ballStop();
+                            // 这个里面只有往左的
+                            self.ball.minePeelRToL_01();
+                        }
+                    }, 0.2);
+
                 } else {
                     self.mine.pat.pat();
                 }
@@ -136,6 +147,12 @@ cc.Class({
 
         // 配置球的状态判断回调
         this.ball.stateCallback = function(state) {
+            // 此处为测试球运动专用功能
+            // if (state == this.ballconfig.BALL_STATE_DROP_IN_RIVAL || 
+            //     state == this.ballconfig.BALL_STATE_DROP_IN_MINE) {
+            //         return
+            //     }
+
             self.ballstate = state;
         };
     },
@@ -143,6 +160,13 @@ cc.Class({
     // 功能性方法
     // 帧判断,用来检测球状态,给对手的行为进行决策
     rivalUpdate:function (delay) {
+        // 需要保证不打扰削球动作
+        if (this.rival.ispeel == true) {
+            return;
+        }
+
+        this.rival.ispeel = false;
+
         var value = Math.random() * 2;
 
         if (this.ballstate == this.ballconfig.BALL_STATE_RIVAL_LEFT_PAT) {
@@ -158,17 +182,26 @@ cc.Class({
                 this.ball.rivalPatLToR_01();
             }
         } else if (this.ballstate == this.ballconfig.BALL_STATE_RIVAL_LEFT_PEEL) {
-            this.ball.ballStop();
+            this.rival.ispeel = true;
             this.rival.peel.peel();
             this.rival.setDir(3);
-            // 敌方左侧可削
-            if (value > 1) {
-                // 往左侧削
-                this.ball.rivalPeelLtoL_01();
-            } else {
-                // 往右侧削
-                this.ball.rivalPeelLtoR_01();
-            }
+
+            var self = this;
+            this.scheduleOnce (function() {
+                self.rival.ispeel = false;
+
+                if (!this.isEnd) {
+                    this.ball.ballStop();
+                    // 敌方左侧可削
+                    if (value > 1) {
+                        // 往左侧削
+                        this.ball.rivalPeelLtoL_01();
+                    } else {
+                        // 往右侧削
+                        this.ball.rivalPeelLtoR_01();
+                    }
+                }
+            }, 0.2);
         } else if (this.ballstate == this.ballconfig.BALL_STATE_RIVAL_RIGHT_PAT) {
             this.ball.ballStop();
             this.rival.pat.pat();
@@ -205,6 +238,7 @@ cc.Class({
 
     // 游戏开始
     gameStart:function() {
+        this.ballstate = this.ballconfig.BALL_STATE_SERVE_START;
         this.ball.ballEnd();
         // 将双方置为等待状态
         this.mine.idle.idle();
@@ -220,7 +254,8 @@ cc.Class({
         // 游戏开始,对方开始发球
         this.rival.setDir(4);
         this.rival.roleServe();
-        this.schedule(this.rivalUpdate, 1);
+        cc.log ("发起了 .. ")
+        this.schedule(this.rivalUpdate, 1.0 / 60);
     },
 
     // 回合结束
@@ -228,6 +263,10 @@ cc.Class({
         this.unschedule(this.rivalUpdate);
         this.isEnd = true;
 
+        // 停止动作,主要是为了停止回调
+        this.mine.stop();
+        this.rival.stop();
+
         if (this.win) {
             cc.log ("游戏结束,胜利了 .. ")
             this.mine.win.win();
@@ -284,6 +323,13 @@ cc.Class({
 
     // 点击排行榜
     rankClicked:function() {
-        this.rank.showRank();
+        if (cc.sys.platform == cc.sys.WECHAT_GAME) {
+            wx.shareAppMessage({
+                withShareTicket: true,
+                title: '我要主动拉起分享啦',
+                success: function(shareTickets,groupMsgInfos){console.log('主动成功')},
+                fail: function(res){console.log('主动失败');console.log(res);},
+            });
+        }
     }
 });

+ 5 - 24
assets/scripts/ctrls/rankctrl.js

@@ -50,28 +50,9 @@ cc.Class({
             })
         }
     },
-
-    // update (dt) {
-    //     if (this.texture) {
-    //         this.showRank();
-    //     }
-    // },
-
-    // 外部调用
-    // 展示排行榜
-    showRank:function() {
-        if (cc.sys.platform == cc.sys.WECHAT_GAME) {
-            // var openDataContext = wx.getOpenDataContext();
-            // var sharedCanvas = openDataContext.canvas;
-            // this.texture.initWithElement(sharedCanvas);
-            // this.texture.handleLoadedTexture();
-            // this.panel.spriteFrame = new cc.SpriteFrame(this.texture);
-
-            // if (openDataContext == null) {
-            //     console.log ("没有 openDataContext ")
-            // } else {
-            //     console.log ("有 openDataContext ")
-            // }
-        }
-    }
+    
+    // 事件
+    backClicked:function() {
+        cc.director.loadScene("startscene")
+    },
 });

+ 1 - 1
assets/scripts/ctrls/startctrl.js

@@ -33,7 +33,7 @@ cc.Class({
     rankClicked:function() {
         cc.log("排行 。。。 ");
 
-        this.rank.showRank();
+        cc.director.loadScene("rankscene")
     },
 
     // 开始

+ 7 - 1
assets/scripts/role.js

@@ -102,7 +102,6 @@ cc.Class({
     // 外部调用
     // 设置位置
     setDir:function(dir) {
-        cc.log ("Dir = " + dir);
         if (dir == RoleDir.Role_Mine_Left) {
             this.node.setPosition(this.mineLeft);
         } else if (dir == RoleDir.Role_Mine_Right) {
@@ -119,6 +118,13 @@ cc.Class({
         this.serve.serve();
     },
 
+    // 停止
+    stop:function() {
+        this.serve.stop();
+        this.pat.stop();
+        this.peel.stop();
+    },
+
     // 角色的帧动作
     roleUpdate:function() {
 

+ 2 - 2
settings/builder.json

@@ -35,12 +35,12 @@
     "orientation": "portrait",
     "zip": false
   },
-  "startScene": "a7c41137-753e-451d-8e26-d3dea70577e4",
+  "startScene": "72faeac9-9b25-4492-aa18-fd28d18e3ad1",
   "title": "PingPongPro",
   "webOrientation": "portrait",
   "wechatgame": {
     "REMOTE_SERVER_ROOT": "",
-    "appid": "wxe6c0b591d4a905d1",
+    "appid": "wxe14bf238aced82dd",
     "orientation": "portrait",
     "subContext": "wx_open_data_center"
   },

+ 1 - 1
settings/project.json

@@ -23,7 +23,7 @@
   "group-list": [
     "default"
   ],
-  "last-module-event-record-time": 1560337190901,
+  "last-module-event-record-time": 1560945178185,
   "simulator-orientation": false,
   "simulator-resolution": {
     "height": 640,