Parcourir la source

准备删除之前的动作架构

芋圆号航母 il y a 6 ans
Parent
commit
c2c09aa79b
90 fichiers modifiés avec 5831 ajouts et 189 suppressions
  1. BIN
      assets/resources/00114d.jpg
  2. 4 4
      assets/resources/00194d.jpg.meta
  3. BIN
      assets/resources/00115d.jpg
  4. 4 4
      assets/resources/00203d.jpg.meta
  5. BIN
      assets/resources/00116d.jpg
  6. 31 0
      assets/resources/00116d.jpg.meta
  7. BIN
      assets/resources/00117d.jpg
  8. 31 0
      assets/resources/00117d.jpg.meta
  9. BIN
      assets/resources/00118d.jpg
  10. 31 0
      assets/resources/00118d.jpg.meta
  11. BIN
      assets/resources/00119d.jpg
  12. 31 0
      assets/resources/00119d.jpg.meta
  13. BIN
      assets/resources/00120d.jpg
  14. 4 4
      assets/resources/00193d.jpg.meta
  15. BIN
      assets/resources/00192d.jpg
  16. BIN
      assets/resources/00193d.jpg
  17. BIN
      assets/resources/00194d.jpg
  18. BIN
      assets/resources/00203d.jpg
  19. BIN
      assets/resources/00204d.jpg
  20. 0 31
      assets/resources/00204d.jpg.meta
  21. BIN
      assets/resources/00205d.jpg
  22. 0 31
      assets/resources/00205d.jpg.meta
  23. BIN
      assets/resources/00206d.jpg
  24. 0 31
      assets/resources/00206d.jpg.meta
  25. BIN
      assets/resources/00249d.jpg
  26. 31 0
      assets/resources/00249d.jpg.meta
  27. BIN
      assets/resources/00266d.jpg
  28. 4 4
      assets/resources/00192d.jpg.meta
  29. BIN
      assets/resources/all.jpg
  30. 31 0
      assets/resources/all.jpg.meta
  31. BIN
      assets/resources/mine_left_to_left.png
  32. 31 0
      assets/resources/mine_left_to_left.png.meta
  33. BIN
      assets/resources/mine_left_to_rival_right.png
  34. 31 0
      assets/resources/mine_left_to_rival_right.png.meta
  35. BIN
      assets/resources/mine_peel_right_to_right.png
  36. 31 0
      assets/resources/mine_peel_right_to_right.png.meta
  37. BIN
      assets/resources/mine_right_to_right.png
  38. 31 0
      assets/resources/mine_right_to_right.png.meta
  39. BIN
      assets/resources/rival_pat_right_to_left.png
  40. 31 0
      assets/resources/rival_pat_right_to_left.png.meta
  41. BIN
      assets/resources/rival_peel_left_to_right.png
  42. 31 0
      assets/resources/rival_peel_left_to_right.png.meta
  43. 1185 0
      assets/scenes/mainscene.fire
  44. 7 0
      assets/scenes/mainscene.fire.meta
  45. 469 43
      assets/scenes/test.fire
  46. 7 0
      assets/scripts/actions.meta
  47. 97 0
      assets/scripts/actions/idle.js
  48. 9 0
      assets/scripts/actions/idle.js.meta
  49. 558 0
      assets/scripts/actions/pat.js
  50. 9 0
      assets/scripts/actions/pat.js.meta
  51. 506 0
      assets/scripts/actions/peel.js
  52. 9 0
      assets/scripts/actions/peel.js.meta
  53. 810 0
      assets/scripts/actions/serve.js
  54. 9 0
      assets/scripts/actions/serve.js.meta
  55. 7 0
      assets/scripts/balls.meta
  56. 304 0
      assets/scripts/balls/ball.js
  57. 9 0
      assets/scripts/balls/ball.js.meta
  58. 66 0
      assets/scripts/balls/bump.js
  59. 9 0
      assets/scripts/balls/bump.js.meta
  60. 111 0
      assets/scripts/balls/minepatltol.js
  61. 9 0
      assets/scripts/balls/minepatltol.js.meta
  62. 108 0
      assets/scripts/balls/minepatltor.js
  63. 9 0
      assets/scripts/balls/minepatltor.js.meta
  64. 41 0
      assets/scripts/balls/minepatrtol.js
  65. 9 0
      assets/scripts/balls/minepatrtol.js.meta
  66. 102 0
      assets/scripts/balls/minepatrtor.js
  67. 9 0
      assets/scripts/balls/minepatrtor.js.meta
  68. 126 0
      assets/scripts/balls/minepeelrtor.js
  69. 9 0
      assets/scripts/balls/minepeelrtor.js.meta
  70. 108 0
      assets/scripts/balls/rivalpatrtol.js
  71. 9 0
      assets/scripts/balls/rivalpatrtol.js.meta
  72. 110 0
      assets/scripts/balls/rivalpeelrtor.js
  73. 9 0
      assets/scripts/balls/rivalpeelrtor.js.meta
  74. 148 0
      assets/scripts/balls/rivalserve.js
  75. 9 0
      assets/scripts/balls/rivalserve.js.meta
  76. 7 0
      assets/scripts/configs.meta
  77. 26 0
      assets/scripts/configs/ballconfig.js
  78. 9 0
      assets/scripts/configs/ballconfig.js.meta
  79. 9 0
      assets/scripts/gameconfig.js
  80. 9 0
      assets/scripts/gameconfig.js.meta
  81. 7 0
      assets/scripts/main.meta
  82. 113 0
      assets/scripts/main/mainctrl.js
  83. 9 0
      assets/scripts/main/mainctrl.js.meta
  84. 105 0
      assets/scripts/role.js
  85. 9 0
      assets/scripts/role.js.meta
  86. 81 0
      assets/scripts/table.js
  87. 9 0
      assets/scripts/table.js.meta
  88. 1 1
      settings/builder.json
  89. 21 21
      settings/project.json
  90. 32 15
      settings/services.json

BIN
assets/resources/00114d.jpg


+ 4 - 4
assets/resources/00194d.jpg.meta

@@ -1,15 +1,15 @@
 {
   "ver": "2.2.0",
-  "uuid": "efe48e27-53d0-4b49-82b1-f088415e1fff",
+  "uuid": "79889877-f592-44ee-9898-a1abd66e52a1",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
   "premultiplyAlpha": false,
   "subMetas": {
-    "00194d": {
+    "00114d": {
       "ver": "1.0.3",
-      "uuid": "5d43e94e-f8fe-4f79-9b8e-049f192cca2b",
-      "rawTextureUuid": "efe48e27-53d0-4b49-82b1-f088415e1fff",
+      "uuid": "e39736b2-63ae-43a6-befd-c40a8ea4b70d",
+      "rawTextureUuid": "79889877-f592-44ee-9898-a1abd66e52a1",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,

BIN
assets/resources/00115d.jpg


+ 4 - 4
assets/resources/00203d.jpg.meta

@@ -1,15 +1,15 @@
 {
   "ver": "2.2.0",
-  "uuid": "13301415-5979-4b58-a264-2dc272b12802",
+  "uuid": "9e1a2f08-8f93-4280-98c4-21c66ac8c2bf",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
   "premultiplyAlpha": false,
   "subMetas": {
-    "00203d": {
+    "00115d": {
       "ver": "1.0.3",
-      "uuid": "b6ac8324-0820-44fa-a907-f410c6e739ec",
-      "rawTextureUuid": "13301415-5979-4b58-a264-2dc272b12802",
+      "uuid": "22e412c5-89cf-4c4a-9154-ea848cbaecc7",
+      "rawTextureUuid": "9e1a2f08-8f93-4280-98c4-21c66ac8c2bf",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,

BIN
assets/resources/00116d.jpg


+ 31 - 0
assets/resources/00116d.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "a247fb68-bf73-44a7-99ce-e12add8c7484",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "00116d": {
+      "ver": "1.0.3",
+      "uuid": "3903e71f-1e0f-4ffa-98ea-fa48f3e0df2b",
+      "rawTextureUuid": "a247fb68-bf73-44a7-99ce-e12add8c7484",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/00117d.jpg


+ 31 - 0
assets/resources/00117d.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "c38fd924-ff0c-4ce0-aa00-c83746c68a4a",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "00117d": {
+      "ver": "1.0.3",
+      "uuid": "367e8ab4-651a-41f8-a711-7dd7c4b77dc4",
+      "rawTextureUuid": "c38fd924-ff0c-4ce0-aa00-c83746c68a4a",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/00118d.jpg


+ 31 - 0
assets/resources/00118d.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "d3bc0215-590b-4794-b128-207bf0de1b8d",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "00118d": {
+      "ver": "1.0.3",
+      "uuid": "757565ec-b50e-41f6-b3cb-fe27bc676cb1",
+      "rawTextureUuid": "d3bc0215-590b-4794-b128-207bf0de1b8d",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/00119d.jpg


+ 31 - 0
assets/resources/00119d.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "8edc7c86-bbe2-420d-8130-04058914dd4e",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "00119d": {
+      "ver": "1.0.3",
+      "uuid": "3b8de088-875b-4525-8c2f-91c3b14047f4",
+      "rawTextureUuid": "8edc7c86-bbe2-420d-8130-04058914dd4e",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/00120d.jpg


+ 4 - 4
assets/resources/00193d.jpg.meta

@@ -1,15 +1,15 @@
 {
   "ver": "2.2.0",
-  "uuid": "b7a92ac7-cda2-42bf-94ad-198c1be1fd19",
+  "uuid": "c481f3ef-623f-4974-8041-d8568fd216b9",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
   "premultiplyAlpha": false,
   "subMetas": {
-    "00193d": {
+    "00120d": {
       "ver": "1.0.3",
-      "uuid": "ae51f1ba-3bbf-46eb-ba6f-a585c8f5d66b",
-      "rawTextureUuid": "b7a92ac7-cda2-42bf-94ad-198c1be1fd19",
+      "uuid": "ad19c466-2bdf-4158-a848-b2d7113be022",
+      "rawTextureUuid": "c481f3ef-623f-4974-8041-d8568fd216b9",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,

BIN
assets/resources/00192d.jpg


BIN
assets/resources/00193d.jpg


BIN
assets/resources/00194d.jpg


BIN
assets/resources/00203d.jpg


BIN
assets/resources/00204d.jpg


+ 0 - 31
assets/resources/00204d.jpg.meta

@@ -1,31 +0,0 @@
-{
-  "ver": "2.2.0",
-  "uuid": "08aeb655-f85a-4a38-bade-cdbd3024f1b2",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "subMetas": {
-    "00204d": {
-      "ver": "1.0.3",
-      "uuid": "1663eb28-9e71-44ea-a5a4-a39a6ef789b4",
-      "rawTextureUuid": "08aeb655-f85a-4a38-bade-cdbd3024f1b2",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 544,
-      "height": 960,
-      "rawWidth": 544,
-      "rawHeight": 960,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/resources/00205d.jpg


+ 0 - 31
assets/resources/00205d.jpg.meta

@@ -1,31 +0,0 @@
-{
-  "ver": "2.2.0",
-  "uuid": "39f06403-ae63-4733-9d76-034818ee3b3d",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "subMetas": {
-    "00205d": {
-      "ver": "1.0.3",
-      "uuid": "de735ce8-e18a-48ec-841e-604d3bb6c8f5",
-      "rawTextureUuid": "39f06403-ae63-4733-9d76-034818ee3b3d",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 544,
-      "height": 960,
-      "rawWidth": 544,
-      "rawHeight": 960,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/resources/00206d.jpg


+ 0 - 31
assets/resources/00206d.jpg.meta

@@ -1,31 +0,0 @@
-{
-  "ver": "2.2.0",
-  "uuid": "c5aaec02-62d3-4fcc-9a69-992d140476f8",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "subMetas": {
-    "00206d": {
-      "ver": "1.0.3",
-      "uuid": "b5517b2e-f403-49be-96d9-efb6fef03f90",
-      "rawTextureUuid": "c5aaec02-62d3-4fcc-9a69-992d140476f8",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 544,
-      "height": 960,
-      "rawWidth": 544,
-      "rawHeight": 960,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

BIN
assets/resources/00249d.jpg


+ 31 - 0
assets/resources/00249d.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "47621a77-e5e6-4243-becc-470bcb96155d",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "00249d": {
+      "ver": "1.0.3",
+      "uuid": "c0e869a4-e0e8-48a9-bc2b-dae3ac718e18",
+      "rawTextureUuid": "47621a77-e5e6-4243-becc-470bcb96155d",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/00266d.jpg


+ 4 - 4
assets/resources/00192d.jpg.meta

@@ -1,15 +1,15 @@
 {
   "ver": "2.2.0",
-  "uuid": "9d0bd229-ba88-42da-9354-73fac8ea3b7a",
+  "uuid": "a1a31a84-0d05-403b-8ba3-129f198b17b3",
   "type": "sprite",
   "wrapMode": "clamp",
   "filterMode": "bilinear",
   "premultiplyAlpha": false,
   "subMetas": {
-    "00192d": {
+    "00266d": {
       "ver": "1.0.3",
-      "uuid": "410e432b-8743-450b-bcca-76d6c2617153",
-      "rawTextureUuid": "9d0bd229-ba88-42da-9354-73fac8ea3b7a",
+      "uuid": "c8009869-264d-4ba6-9b40-5a51e35a068e",
+      "rawTextureUuid": "a1a31a84-0d05-403b-8ba3-129f198b17b3",
       "trimType": "auto",
       "trimThreshold": 1,
       "rotated": false,

BIN
assets/resources/all.jpg


+ 31 - 0
assets/resources/all.jpg.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "81a9e83f-bcd2-4831-9ecc-7e3d29c77562",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "all": {
+      "ver": "1.0.3",
+      "uuid": "295c783e-3e80-4a11-b239-7e9a2ec0c4e2",
+      "rawTextureUuid": "81a9e83f-bcd2-4831-9ecc-7e3d29c77562",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/mine_left_to_left.png


+ 31 - 0
assets/resources/mine_left_to_left.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "7c92cbb7-b2e7-4c68-bd83-fcda091126c7",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "mine_left_to_left": {
+      "ver": "1.0.3",
+      "uuid": "a47a28c8-d0f2-4fb7-952c-f7e3592cdb04",
+      "rawTextureUuid": "7c92cbb7-b2e7-4c68-bd83-fcda091126c7",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/mine_left_to_rival_right.png


+ 31 - 0
assets/resources/mine_left_to_rival_right.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "43ed3e94-14c7-49f3-909d-b3cb15024a88",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "mine_left_to_rival_right": {
+      "ver": "1.0.3",
+      "uuid": "5674ae5b-987d-463b-addb-e80460b66bb0",
+      "rawTextureUuid": "43ed3e94-14c7-49f3-909d-b3cb15024a88",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/mine_peel_right_to_right.png


+ 31 - 0
assets/resources/mine_peel_right_to_right.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "84e8ae80-f053-4c49-a089-ff72202aeb1f",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "mine_peel_right_to_right": {
+      "ver": "1.0.3",
+      "uuid": "b5a7fdfd-4d74-4b1f-9dfd-d11e3999e895",
+      "rawTextureUuid": "84e8ae80-f053-4c49-a089-ff72202aeb1f",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/mine_right_to_right.png


+ 31 - 0
assets/resources/mine_right_to_right.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "783dbdc4-fe35-486f-9c63-b80a53dfcd27",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "mine_right_to_right": {
+      "ver": "1.0.3",
+      "uuid": "6188ebdf-02e6-4f90-8541-3cb7d16e69d0",
+      "rawTextureUuid": "783dbdc4-fe35-486f-9c63-b80a53dfcd27",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/rival_pat_right_to_left.png


+ 31 - 0
assets/resources/rival_pat_right_to_left.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "10d8e3f4-b3e5-48f9-903f-8e2488e556f9",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "rival_pat_right_to_left": {
+      "ver": "1.0.3",
+      "uuid": "6c8be7f8-80b9-47cc-a202-03ba387ca43d",
+      "rawTextureUuid": "10d8e3f4-b3e5-48f9-903f-8e2488e556f9",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/rival_peel_left_to_right.png


+ 31 - 0
assets/resources/rival_peel_left_to_right.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "a85c1cd6-3212-4c82-92ba-8135318dd83c",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "rival_peel_left_to_right": {
+      "ver": "1.0.3",
+      "uuid": "6e2f30d3-948f-497b-87c8-301534c496ad",
+      "rawTextureUuid": "a85c1cd6-3212-4c82-92ba-8135318dd83c",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 544,
+      "height": 960,
+      "rawWidth": 544,
+      "rawHeight": 960,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

Fichier diff supprimé car celui-ci est trop grand
+ 1185 - 0
assets/scenes/mainscene.fire


+ 7 - 0
assets/scenes/mainscene.fire.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "8dbe4f3e-8fdd-4f05-9529-bfdb62f68194",
+  "asyncLoadAssets": false,
+  "autoReleaseAssets": false,
+  "subMetas": {}
+}

+ 469 - 43
assets/scenes/test.fire

@@ -41,8 +41,8 @@
     },
     "_scale": {
       "__type__": "cc.Vec3",
-      "x": 1.5041040209293357,
-      "y": 1.5041040209293357,
+      "x": 1.4298030150983307,
+      "y": 1.4298030150983307,
       "z": 1
     },
     "_quat": {
@@ -81,13 +81,25 @@
       },
       {
         "__id__": 16
+      },
+      {
+        "__id__": 19
+      },
+      {
+        "__id__": 22
+      },
+      {
+        "__id__": 25
+      },
+      {
+        "__id__": 26
       }
     ],
     "_active": true,
     "_level": 1,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 32
       }
     ],
     "_prefab": null,
@@ -101,8 +113,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 960,
-      "height": 640
+      "width": 544,
+      "height": 960
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -111,8 +123,8 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 480,
-      "y": 320,
+      "x": 272,
+      "y": 480,
       "z": 0
     },
     "_scale": {
@@ -225,7 +237,7 @@
       "__id__": 2
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 2,
     "_components": [
       {
@@ -253,8 +265,8 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -2,
-      "y": -91,
+      "x": 0,
+      "y": 0,
       "z": 0
     },
     "_scale": {
@@ -286,7 +298,7 @@
     },
     "_enabled": true,
     "_spriteFrame": {
-      "__uuid__": "b5517b2e-f403-49be-96d9-efb6fef03f90"
+      "__uuid__": "233a20cf-14bd-4df2-a39e-fd80b9b5cc3e"
     },
     "_type": 0,
     "_sizeMode": 1,
@@ -313,7 +325,7 @@
       "__id__": 2
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_level": 2,
     "_components": [
       {
@@ -344,8 +356,8 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 135,
-      "y": 90.3,
+      "x": -139,
+      "y": 180,
       "z": 0
     },
     "_scale": {
@@ -397,7 +409,7 @@
     "_id": "56stRaiEVHsLRn8h0aSaZD"
   },
   {
-    "__type__": "9b763RRFANEZpwNwLVyxX2V",
+    "__type__": "51d31BrFdpJpIHcwJIpvSGN",
     "_name": "",
     "_objFlags": 0,
     "node": {
@@ -405,13 +417,7 @@
     },
     "_enabled": true,
     "loc": 0,
-    "g": null,
-    "index": 15,
-    "headSize": 6,
-    "bodySize": 16,
-    "batSize": 2,
-    "dir": 0,
-    "_id": "ebF597lBtMm6kcXfflQVjU"
+    "_id": "4b6rCIbCVEUKVW0y70Issj"
   },
   {
     "__type__": "cc.Node",
@@ -452,8 +458,8 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
+      "x": 137,
+      "y": 180.8,
       "z": 0
     },
     "_scale": {
@@ -505,21 +511,15 @@
     "_id": "1b4jgW6jFEzbSiDtZ115VN"
   },
   {
-    "__type__": "9b763RRFANEZpwNwLVyxX2V",
+    "__type__": "51d31BrFdpJpIHcwJIpvSGN",
     "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 10
     },
     "_enabled": true,
-    "loc": 0,
-    "g": null,
-    "index": 2,
-    "headSize": 6,
-    "bodySize": 16,
-    "batSize": 2,
-    "dir": 0,
-    "_id": "60sPLgvtxNnZze+WjkN2Sd"
+    "loc": 1,
+    "_id": "0a+XPHBq5Jb52joUvSm+hq"
   },
   {
     "__type__": "cc.Node",
@@ -613,7 +613,7 @@
     "_id": "af38rOv91KB5RiPFtpad6E"
   },
   {
-    "__type__": "9b763RRFANEZpwNwLVyxX2V",
+    "__type__": "60e04sdIgRDlqSbuXmIcuKz",
     "_name": "",
     "_objFlags": 0,
     "node": {
@@ -621,13 +621,7 @@
     },
     "_enabled": true,
     "loc": 0,
-    "g": null,
-    "index": 3,
-    "headSize": 6,
-    "bodySize": 16,
-    "batSize": 2,
-    "dir": 0,
-    "_id": "b8AUssJP9C95NV75V2+lhk"
+    "_id": "62cNR6S6xDn5rP8cL+9oUX"
   },
   {
     "__type__": "cc.Node",
@@ -738,6 +732,438 @@
     "_id": "b7w5L0jcFFuITXdzNrwmWT"
   },
   {
+    "__type__": "cc.Node",
+    "_name": "table",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": false,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 20
+      },
+      {
+        "__id__": 21
+      }
+    ],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -13,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "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": "794wxGDi9MPrb1NCCi+Q4G"
+  },
+  {
+    "__type__": "cc.Graphics",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 19
+    },
+    "_enabled": true,
+    "_lineWidth": 1,
+    "_strokeColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_lineJoin": 2,
+    "_lineCap": 0,
+    "_fillColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_miterLimit": 10,
+    "_id": "f6GpUftbJAjqJ3b3j0bCfi"
+  },
+  {
+    "__type__": "76b41BHpmtGnpukZx0Ab23o",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 19
+    },
+    "_enabled": true,
+    "g": {
+      "__id__": 20
+    },
+    "_id": "5fLodwgK9DCIa/k1uCa757"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "ball",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 23
+      },
+      {
+        "__id__": 24
+      }
+    ],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "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": "28SRVosQ9Ksam7cdgDYNtn"
+  },
+  {
+    "__type__": "cc.Graphics",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 22
+    },
+    "_enabled": true,
+    "_lineWidth": 1,
+    "_strokeColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_lineJoin": 2,
+    "_lineCap": 0,
+    "_fillColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_miterLimit": 10,
+    "_id": "6e2eai0GtAsLfiurLM6asc"
+  },
+  {
+    "__type__": "81123k/yoJPEagU8RpuVb2d",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 22
+    },
+    "_enabled": true,
+    "g": {
+      "__id__": 23
+    },
+    "action": 1,
+    "head": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "center": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "tail": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": "7f2ymWcrRHi5RwDcwEp8uY"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "gamemanager",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 2,
+    "_components": [],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "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": "ec55i1XtdCCI79TFIXI/1x"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "role",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_level": 2,
+    "_components": [
+      {
+        "__id__": 27
+      },
+      {
+        "__id__": 28
+      },
+      {
+        "__id__": 31
+      },
+      {
+        "__id__": 30
+      },
+      {
+        "__id__": 29
+      }
+    ],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_position": {
+      "__type__": "cc.Vec3",
+      "x": 138.1,
+      "y": 180,
+      "z": 0
+    },
+    "_scale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "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": "7bmX5ekXtEd6LtdQ619yEf"
+  },
+  {
+    "__type__": "cc.Graphics",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 26
+    },
+    "_enabled": true,
+    "_lineWidth": 1,
+    "_strokeColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_lineJoin": 2,
+    "_lineCap": 0,
+    "_fillColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_miterLimit": 10,
+    "_id": "22VE3d/z1Fj5Q+2z89pHaE"
+  },
+  {
+    "__type__": "8fad4x7duhGdKL/jEqD6o6a",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 26
+    },
+    "_enabled": true,
+    "serve": {
+      "__id__": 29
+    },
+    "pat": {
+      "__id__": 30
+    },
+    "idle": {
+      "__id__": 31
+    },
+    "_id": "cfANq3709G4Lcwg0QdYtVl"
+  },
+  {
+    "__type__": "60e04sdIgRDlqSbuXmIcuKz",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 26
+    },
+    "_enabled": true,
+    "loc": 1,
+    "_id": "ecTq8X6Z5ISpUqpkW+FMS1"
+  },
+  {
+    "__type__": "51d31BrFdpJpIHcwJIpvSGN",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 26
+    },
+    "_enabled": true,
+    "loc": 1,
+    "_id": "17kQclmR9HUa5VzNNtfVC6"
+  },
+  {
+    "__type__": "0f271wW4ylKC4tilUvrmCGv",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 26
+    },
+    "_enabled": true,
+    "loc": 1,
+    "_id": "858mtA39ZBBbzfJRwJJI4J"
+  },
+  {
     "__type__": "cc.Canvas",
     "_name": "",
     "_objFlags": 0,
@@ -747,8 +1173,8 @@
     "_enabled": true,
     "_designResolution": {
       "__type__": "cc.Size",
-      "width": 960,
-      "height": 640
+      "width": 544,
+      "height": 960
     },
     "_fitWidth": false,
     "_fitHeight": true,

+ 7 - 0
assets/scripts/actions.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "15864db9-e435-4027-8b2e-314a87ac7542",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 97 - 0
assets/scripts/actions/idle.js

@@ -0,0 +1,97 @@
+// 静止
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        loc: 0, // 代表方向,0为正位,1为反位
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+
+        // 配置方向
+        if (this.loc == 0) {
+            this.dir = -1;
+        } else {
+            this.dir = 1;
+        }
+    },
+
+    start () {
+    },
+
+    // update (dt) {},
+
+    idle:function() {
+        this.g.clear();
+        
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(-1.5 * this.dir, 110, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(8 * this.dir, 85, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(-7 * this.dir, 86);
+        var handEnd = cc.v2(handStart.x - this.dir * 10, handStart.y - 47);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x, handStart.y - 40, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 3, handEnd.y + 4, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(13 * this.dir, 99);
+        var handEnd = cc.v2(handStart.x + this.dir * 51, handStart.y - 18);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x + this.dir * 27, handStart.y + 10, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(0, 74);
+        var trousersEnd = cc.v2(22 * this.dir, 79);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(10 * this.dir, 73);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -10 * this.dir, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(19 * this.dir, 78);
+        legEnd = cc.v2(62 * this.dir, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.lineTo(legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/actions/idle.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "0f271c16-e329-4a0b-8b62-954beb9821af",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

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

@@ -0,0 +1,558 @@
+// 拍球的动作
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        loc: 0, // 代表方向,0为正位,1为反位
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+
+        // 配置方向
+        if (this.loc == 0) {
+            this.dir = -1;
+        } else {
+            this.dir = 1;
+        }
+
+        // this.dir = -1;
+        // this.pat_001();
+        this.index = 1;
+    },
+
+    // update (dt) {},
+
+    pat:function() {
+        this.schedule(this.patUpdate, 1.0 / 15);
+    },
+
+    patUpdate:function(delay) {
+        this.g.clear();
+        if (this.index > 7) {
+            this.index = 1;
+            this.unschedule(this.patUpdate);
+
+            if (this.actionEnd != null) {
+                this.actionEnd();
+            }
+
+            return;
+        }
+
+        if (this.index == 1) {
+            this.pat_001();
+        } else if (this.index == 2) {
+            this.pat_002();
+        } else if (this.index == 3) {
+            this.pat_003();
+        } else if (this.index == 4) {
+            this.pat_004();
+        } else if (this.index == 5) {
+            this.pat_005();
+        } else if (this.index == 6) {
+            this.pat_006();
+        } else if (this.index == 7) {
+            this.pat_007();
+        }
+        this.index++;
+    },
+
+    pat_001:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(this.dir * 1, 112, this.config.HEAD_SIZE + 2, Math.PI / 2 - this.dir * Math.PI / 12, Math.PI * 1.5 - this.dir * Math.PI / 12, this.dir == 1);
+        this.g.lineTo(this.dir *12, 105);
+        this.g.arc(this.dir *13, 111, this.config.HEAD_SIZE + 2, Math.PI * 1.5 - this.dir * Math.PI / 12, Math.PI / 2 - this.dir * Math.PI / 12, this.dir == 1);
+        this.g.lineTo(this.dir *2, 118);
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 21, 81, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 9, 89);
+        var handEnd = cc.v2(handStart.x - this.dir * 52, handStart.y + 7);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x - this.dir * 30, handStart.y + 28, handEnd.x, handEnd.y);
+        this.g.stroke();
+        
+        // 画个球拍
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        if (this.loc == 0) {
+            this.g.arc(this.dir * -41, 105, this.config.BAT_SIZE + 2, 0 + Math.PI / 12, Math.PI + Math.PI / 12, true);
+        } else {
+            this.g.arc(this.dir * -41, 105, this.config.BAT_SIZE + 2, Math.PI - Math.PI / 12, 0 - Math.PI / 12, false);
+        }
+
+        this.g.bezierCurveTo(this.dir * -37, 104, this.dir * -47, 80, this.dir * -24, 53);
+
+        if (this.loc == 0) {
+            this.g.arc(this.dir * -28, 51, this.config.BAT_SIZE + 2, Math.PI - Math.PI / 12, Math.PI * 1.5 + Math.PI / 12, true);
+        } else {
+            this.g.arc(this.dir * -28, 51, this.config.BAT_SIZE + 2, 0 + Math.PI / 12, Math.PI * 1.5 - Math.PI / 12, false);
+        }
+
+        this.g.bezierCurveTo(this.dir * -30, 46, this.dir * -60, 75, this.dir * -45, 106);
+        // this.g.close();
+        this.g.stroke();
+
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 35, 84);
+        var handEnd = cc.v2(this.dir * 76, 61);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 58, 55, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 11, 73);
+        var trousersEnd = cc.v2(this.dir * 33, 73);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 12, 70);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -15, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 10, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 31, 69);
+        legEnd = cc.v2(this.dir * 64, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + this.dir * 20, legStart.y - 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 10, legEnd.y);
+        this.g.stroke();
+    },
+
+    pat_002:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 32, 89);
+        var handEnd = cc.v2(this.dir * 39, 139);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 10, 125, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(this.dir * 27, 109, this.config.HEAD_SIZE, Math.PI / 2 - this.dir * Math.PI / 12, Math.PI * 1.5 - this.dir * Math.PI / 12, this.dir == 1);
+        this.g.lineTo(this.dir * 45, 102);
+        this.g.arc(this.dir * 45, 106, this.config.HEAD_SIZE, Math.PI * 1.5 - this.dir * Math.PI / 12, Math.PI / 2 - this.dir * Math.PI / 12, this.dir == 1);
+        this.g.lineTo(this.dir * 27, 113);
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 41, 82, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+        
+        // 画个球拍
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        if (this.loc == 0) {
+            this.g.arc(32, 124, this.config.BAT_SIZE + 2, Math.PI / 2, Math.PI * 1.5, false);
+        } else {
+            this.g.arc(-32, 124, this.config.BAT_SIZE + 2, Math.PI - Math.PI / 4, Math.PI * 1.5 + Math.PI / 8, true);
+        }
+        this.g.bezierCurveTo(this.dir * -31, 123, 0, 155, this.dir * 40, 134);
+
+        if (this.loc == 0) {
+            this.g.arc(-40, 138, this.config.BAT_SIZE + 2, Math.PI * 1.5 + Math.PI / 8, Math.PI / 2 + Math.PI / 4, false);
+        } else {
+            this.g.arc(42, 138, this.config.BAT_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 + Math.PI / 8, true);
+        }
+        
+        this.g.bezierCurveTo(this.dir * 45, 142, 0, 162, this.dir * -37, 128);
+        // // this.g.close();
+        this.g.stroke();
+
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 52, 72);
+        var handEnd = cc.v2(this.dir * 53, 25);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 45, 55, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 29, 78);
+        var trousersEnd = cc.v2(this.dir * 51, 69);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 32, 71);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 10, 38, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 43, 67);
+        legEnd = cc.v2(this.dir * 64, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 62, 55, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    pat_003:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(this.dir * 53, 104, this.config.HEAD_SIZE + 1, Math.PI / 2 - this.dir * Math.PI / 12, Math.PI * 1.5 - this.dir * Math.PI / 8, this.dir == 1);
+        this.g.lineTo(this.dir * 65, 96);
+        this.g.arc(this.dir * 66, 101, this.config.HEAD_SIZE + 1, Math.PI * 1.5 - this.dir * Math.PI / 8, Math.PI / 2 - this.dir * Math.PI / 8, this.dir == 1);
+        this.g.lineTo(this.dir * 49, 110);;
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 54, 78, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 45, 89);
+        var handEnd = cc.v2(this.dir * 70, 135);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 20, 128, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 1, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 55, 63);
+        var handEnd = cc.v2(this.dir * 56, 30);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 40, 40, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 41, 73);
+        var trousersEnd = cc.v2(this.dir * 63, 66);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 44, 67);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 30, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 57, 64);
+        legEnd = cc.v2(this.dir * 63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + this.dir * 40, legStart.y - 15, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    pat_004:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 84, 92, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 66, 73, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 67, 88);
+        var handEnd = cc.v2(this.dir * 105, 90);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 94, 125, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 4, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 68, 59);
+        var handEnd = cc.v2(this.dir * 60, 33);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 50, 40, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 51, 72);
+        var trousersEnd = cc.v2(this.dir * 70, 60);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 53, 66);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.lineTo(legEnd.x, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 68, 57);
+        legEnd = cc.v2(this.dir * 63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + this.dir * 38, legStart.y - 18, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+    
+    pat_005:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 60, 86, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 43, 66, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 37, 78);
+        var handEnd = cc.v2(this.dir * 62, 110);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 20, 120, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 4, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 56, 61);
+        var handEnd = cc.v2(this.dir * 80, 25);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 70, 32, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 28, 61);
+        var trousersEnd = cc.v2(this.dir * 53, 55);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 33, 54);
+        var legEnd = cc.v2(this.dir * 6, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -15, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(0, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 51, 52);
+        legEnd = cc.v2(this.dir * 68, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + this.dir * 38, legStart.y - 18, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+    
+    pat_006:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(this.dir * 37, 104, this.config.HEAD_SIZE + 2, Math.PI / 2 - this.dir * Math.PI / 8, Math.PI * 1.5 - this.dir * Math.PI / 8, this.dir == 1);
+        this.g.lineTo(this.dir * 44, 96);
+        this.g.arc(this.dir * 46, 101, this.config.HEAD_SIZE + 2, Math.PI * 1.5 - this.dir * Math.PI / 8, Math.PI / 2 - this.dir * Math.PI / 8, this.dir == 1);
+        this.g.lineTo(this.dir * 38, 110);
+        // // this.g.close();
+        // // this.g.stroke();
+        // // this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 32, 78, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 23, 88);
+        var handEnd = cc.v2(this.dir * -12, 127);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -23, 95, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x + this.dir * 5, handEnd.y - 1, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 46, 81);
+        var handEnd = cc.v2(this.dir * 76, 49);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 75, 82, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 19, 71);
+        var trousersEnd = cc.v2(this.dir * 42, 67);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 22, 66);
+        var legEnd = cc.v2(this.dir * 6, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -10, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(0, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 38, 64);
+        legEnd = cc.v2(this.dir * 68, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 65, 55, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+    
+    pat_007:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(this.dir * -4, 111.5, this.config.HEAD_SIZE, Math.PI / 2, Math.PI * 1.5, this.dir == 1);
+        this.g.lineTo(this.dir * 8, 106.5);
+        this.g.arc(this.dir * 7, 111.5, this.config.HEAD_SIZE, Math.PI * 1.5 , Math.PI / 2, this.dir == 1);
+        this.g.lineTo(this.dir * -4, 116);
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 7, 87, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * -8, 87);
+        var handEnd = cc.v2(this.dir * -32, 45);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -15, 55, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x + this.dir * 1, handEnd.y + 6, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 16, 99);
+        var handEnd = cc.v2(this.dir * 65, 83);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 45, 110, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * -3, 75);
+        var trousersEnd = cc.v2(this.dir * 23, 85);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 8, 72);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -15, 56, legEnd.x, legEnd.y);
+        this.g.lineTo(this.dir * -6, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 18, 77);
+        legEnd = cc.v2(this.dir * 63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.lineTo(legEnd.x, legEnd.y)
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/actions/pat.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "51d3106b-15da-49a4-81dc-c09229bd218d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

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

@@ -0,0 +1,506 @@
+// 削球的动作
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        loc: 0, // 代表方向,0为正位,1为反位
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+        
+        // 配置方向
+        if (this.loc == 0) {
+            this.dir = 1;
+        } else {
+            this.dir = -1;
+        }
+
+        this.index = 1;
+    },
+
+    // start () {},
+
+    peel_001:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * -7, 115, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * -20, 90, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * -7, 95);
+        var handEnd = cc.v2(this.dir * 14, 50);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 3, 60, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x + this.dir * 3, handEnd.y + 2, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * -27, 102);
+        var handEnd = cc.v2(this.dir * -64, 79);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -45, 115, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * -10, 79);
+        var trousersEnd = cc.v2(this.dir * -33, 83);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * -14, 76);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 5, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * -26, 76);
+        legEnd = cc.v2(this.dir * -62, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -55, 35, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_002:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * -56, 85, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * -52, 57, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * -44, 69);
+        var handEnd = cc.v2(this.dir * 6, 54);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -10, 51, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x + this.dir * 2, handEnd.y + 3, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * -63, 66);
+        var handEnd = cc.v2(this.dir * -74, 25);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -105, 52, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * -41, 47);
+        var trousersEnd = cc.v2(this.dir * -66, 51);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * -43, 45);
+        var legEnd = cc.v2(0, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 80, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * -62, 44);
+        legEnd = cc.v2(this.dir * -61, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -140, 65, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_003:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        if (this.loc == 0) {
+            this.g.arc(29, 55, this.config.HEAD_SIZE, Math.PI / 2 - Math.PI / 8, Math.PI * 1.5, true)
+            this.g.lineTo(54, 46);
+            this.g.arc(53, 50, this.config.HEAD_SIZE, Math.PI * 1.5 + Math.PI / 12, Math.PI / 2, true)
+            this.g.lineTo(31, 59);
+        } else {
+            this.g.arc(-29, 55, this.config.HEAD_SIZE, Math.PI / 2 + Math.PI / 8, Math.PI * 1.5, false)
+            this.g.lineTo(-54, 46);
+            this.g.arc(-53, 50, this.config.HEAD_SIZE, Math.PI * 1.5 - Math.PI / 12, Math.PI / 2, false)
+            this.g.lineTo(-31, 59);
+        }
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 45, 23, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 59, 25);
+        var handEnd = cc.v2(this.dir * 79, 66);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 90, 35, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 4, handEnd.y + 1, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 34, 31);
+        var handEnd = cc.v2(this.dir * -28, 38);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 0, 22, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 30, 23);
+        var trousersEnd = cc.v2(this.dir * 51, 9);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(this.dir * 55, 11);
+        var legEnd = cc.v2(this.dir * 100, -32)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(this.dir * 32, 14);
+        legEnd = cc.v2(this.dir * -63, -1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_004:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 60, 47, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 50, 20, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 63, 23);
+        var handEnd = cc.v2(this.dir * 100, 73);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 85, 30, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 5, handEnd.y - 1, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 44, 31);
+        var handEnd = cc.v2(this.dir * -15, 58);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 10, 35, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 35, 25);
+        var trousersEnd = cc.v2(this.dir * 52, 5);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        var legStart = cc.v2(this.dir * 61, 10);
+        var legEnd = cc.v2(this.dir * 100, -33)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        legStart = cc.v2(this.dir * 37, 11);
+        legEnd = cc.v2(this.dir * -66, -1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_005:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 61, 52, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 49, 25, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 63, 28);
+        var handEnd = cc.v2(this.dir * 110, -9);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 85, 19, handEnd.x, handEnd.y);
+        this.g.stroke();
+        
+        // 画个球拍
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        if (this.loc == 0) {
+            // 正位
+            this.g.arc(110, 60, this.config.BAT_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 4, false);
+            this.g.bezierCurveTo(113, 62, 142, 30, 118, -9);
+            this.g.arc(113, -6, this.config.BAT_SIZE + 2, -Math.PI / 8, Math.PI - Math.PI / 4, false);
+            this.g.bezierCurveTo(111, -8, 130, 30, 107, 57);
+        } else {
+            // 逆位
+            this.g.arc(-110, 60, this.config.BAT_SIZE + 2, Math.PI * 1.5 + Math.PI / 8, Math.PI / 4 * 3, true);
+            this.g.bezierCurveTo(-113, 62, -142, 30, -118, -9);
+            this.g.arc(-113, -6, this.config.BAT_SIZE + 2, Math.PI + Math.PI / 8, Math.PI / 4, true);
+            this.g.bezierCurveTo(-111, -8, -130, 30, -107, 57);
+        }
+        this.g.stroke();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 41, 33);
+        var handEnd = cc.v2(this.dir * -12, 58);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 10, 43, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 36, 27);
+        var trousersEnd = cc.v2(this.dir * 51, 10);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        var legStart = cc.v2(this.dir * 54, 10);
+        var legEnd = cc.v2(this.dir * 100, -33)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        legStart = cc.v2(this.dir * 39, 14);
+        legEnd = cc.v2(this.dir * -66, -1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_006:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 68, 56, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 58, 30, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 71, 30);
+        var handEnd = cc.v2(this.dir * 45, -18);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 82, 5, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 1, handEnd.y + 8, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 47, 40);
+        var handEnd = cc.v2(this.dir * -18, 54);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 26, 43, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 43, 31);
+        var trousersEnd = cc.v2(this.dir * 63, 14);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        var legStart = cc.v2(this.dir * 61, 14);
+        var legEnd = cc.v2(this.dir * 100, -33)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 140, 20, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        legStart = cc.v2(this.dir * 45, 21);
+        legEnd = cc.v2(this.dir * -66, -1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    peel_007:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 61, 52, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(this.dir * 50, 25, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 65, 26);
+        var handEnd = cc.v2(this.dir * 33, -4);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 82, -10, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - this.dir * 1, handEnd.y + 6, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(this.dir * 50, 39);
+        var handEnd = cc.v2(this.dir * -21, 42);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 30, 45, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(this.dir * 35, 28);
+        var trousersEnd = cc.v2(this.dir * 53, 10);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        var legStart = cc.v2(this.dir * 57, 12);
+        var legEnd = cc.v2(this.dir * 100, -33)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 140, 20, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        legStart = cc.v2(this.dir * 38, 19);
+        legEnd = cc.v2(this.dir * -66, -1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    // update (dt) {},
+});

+ 9 - 0
assets/scripts/actions/peel.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "805d6925-cdda-40fa-a50c-69d3611d0297",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

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

@@ -0,0 +1,810 @@
+// 发球动作
+// 共有18个动作
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        loc: 0, // 代表方向,0为正位,1为反位
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+        
+        // 配置方向
+        if (this.loc == 0) {
+            this.dir = 1;
+        } else {
+            this.dir = -1;
+        }
+
+        this.index = 1;
+    },
+
+    // start () {},
+
+    // update (dt) {},
+
+    serve:function() {
+        this.schedule(this.serveUpdate, 0.1);
+        // this.serve_014();
+    },
+
+    // 发球的定时器
+    serveUpdate:function(delay) {
+        if (this.index > 19) {
+            this.index = 1;
+        }
+
+        this.g.clear();
+
+        if (this.index == 1) {
+            this.serve_001();
+
+            if (this.actionStart != null) {
+                this.actionStart();
+            }
+        } else if (this.index == 2) {
+            this.serve_002();
+        } else if (this.index == 3) {
+            this.serve_003();
+        } else if (this.index == 4) {
+            this.serve_004();
+        } else if (this.index == 5) {
+            this.serve_005();
+        } else if (this.index == 6) {
+            this.serve_006();
+        } else if (this.index == 7) {
+            this.serve_007();
+        } else if (this.index == 8) {
+            this.serve_008();
+        } else if (this.index == 9) {
+            this.serve_009();
+        } else if (this.index == 10) {
+            this.serve_010();
+        } else if (this.index == 11) {
+            this.serve_011();
+        } else if (this.index == 12) {
+            this.serve_012();
+        } else if (this.index == 13) {
+            this.serve_013();
+        } else if (this.index == 14) {
+            this.serve_014();
+        } else if (this.index == 15) {
+            this.serve_015();
+        } else if (this.index == 16) {
+            this.serve_016();
+        } else if (this.index == 17) {
+            this.serve_017();
+        } else if (this.index == 18) {
+            this.serve_018();
+        } else if (this.index == 19) {
+            this.serve_019();
+
+            if (this.actionEnd != null) {
+                this.unschedule(this.serveUpdate);
+                this.actionEnd();
+            }
+        }
+
+        this.index++;
+    },
+
+    // 一下全是画动作
+    serve_001:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(14, 112, this.config.HEAD_SIZE + 2, Math.PI / 2 + Math.PI / 12, Math.PI * 1.5 + Math.PI / 12, true);
+        this.g.lineTo(29, 107.5);
+        this.g.arc(27, 113, this.config.HEAD_SIZE + 2, Math.PI * 1.5 + Math.PI / 12, Math.PI / 2 + Math.PI / 12, true);
+        this.g.lineTo(11, 118);
+        // this.g.close();
+        // this.g.stroke();
+        // this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(29, 87, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(15, 93);
+        var handEnd = cc.v2(handStart.x - 19, handStart.y - 41);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x - 13, handStart.y - 50, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 2, handEnd.y + 4, 4);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(39, 98);
+        var handEnd = cc.v2(handStart.x + 41, handStart.y - 31);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x + 30, handStart.y + 15, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(19, 78);
+        var trousersEnd = cc.v2(41, 76);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(18, 75);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -3, 55, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 10, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(33, 75);
+        legEnd = cc.v2(64, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 20, legStart.y - 5, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 10, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_002:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(27, 113, this.config.HEAD_SIZE + 2, Math.PI / 2 - Math.PI / 8, Math.PI * 1.5 - Math.PI / 8, true);
+        this.g.lineTo(48, 97);
+        this.g.arc(49, 103, this.config.HEAD_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 - Math.PI / 8, true);
+        this.g.lineTo(28, 119);
+        // // this.g.close();
+        // // this.g.stroke();
+        // // this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(51, 76, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(38, 82);
+        var handEnd = cc.v2(handStart.x - 36, handStart.y - 23);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x - 30, handStart.y - 30, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 1, handEnd.y + 4, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(61, 86);
+        var handEnd = cc.v2(handStart.x + 9, handStart.y - 27);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x + 60, handStart.y - 11, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(38, 67);
+        var trousersEnd = cc.v2(61, 67);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(40, 63);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -5, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(57, 65);
+        legEnd = cc.v2(60, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 55, legStart.y - 35, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_003:function() {
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(54, 105, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(45, 81, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(30, 82);
+        var handEnd = cc.v2(handStart.x - 24, handStart.y - 18);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x - 20, handStart.y - 25, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 1, handEnd.y + 4, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(57, 90);
+        var handEnd = cc.v2(handStart.x - 31, handStart.y + 10);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x + 45, handStart.y - 45, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(32, 71);
+        var trousersEnd = cc.v2(56, 73);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(41, 68);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 0, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(54, 69);
+        legEnd = cc.v2(61, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 50, legStart.y - 30, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_004:function() {
+        this.serve_003();
+    },
+
+    serve_004:function() {
+        this.serve_003();
+    },
+
+    serve_005:function() {
+        this.serve_003();
+    },
+
+    serve_006:function() {
+        this.serve_003();
+    },
+
+    serve_007:function() {
+        this.serve_003();
+    },
+
+    serve_008:function() {
+        this.serve_003();
+    },
+
+    serve_009:function() {
+        this.serve_003();
+    },
+
+    serve_010:function() {
+        this.serve_003();
+    },
+
+    serve_011:function() {
+        this.serve_003();
+    },
+
+    serve_012:function() {
+        this.serve_003();
+    },
+
+    serve_013:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(1, 112, this.config.HEAD_SIZE + 2, Math.PI / 2 - Math.PI / 12, Math.PI * 1.5 - Math.PI / 12, true);
+        this.g.lineTo(12, 105);
+        this.g.arc(13, 111, this.config.HEAD_SIZE + 2, Math.PI * 1.5 - Math.PI / 12, Math.PI / 2 - Math.PI / 12, true);
+        this.g.lineTo(2, 118);
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(21, 81, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(9, 89);
+        var handEnd = cc.v2(handStart.x - 52, handStart.y + 7);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, handStart.x - 30, handStart.y + 28, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(-41, 105, this.config.BAT_SIZE + 2, Math.PI - Math.PI / 12, 0 - Math.PI / 12, false);
+        this.g.bezierCurveTo(-37, 104, -47, 80, -24, 53);
+        this.g.arc(-28, 51, this.config.BAT_SIZE + 2, 0 + Math.PI / 12, Math.PI * 1.5 - Math.PI / 12, false);
+        this.g.bezierCurveTo(-30, 46, -60, 75, -45, 106);
+        // this.g.close();
+        this.g.stroke();
+        // this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(35, 84);
+        var handEnd = cc.v2(76, 61);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 58, 55, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(11, 73);
+        var trousersEnd = cc.v2(33, 73);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(12, 70);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -15, 60, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 10, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(31, 69);
+        legEnd = cc.v2(64, 2)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 20, legStart.y - 10, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 10, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_014:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+
+        // 画手臂
+        var handStart = cc.v2(32, 89);
+        var handEnd = cc.v2(39, 139);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 10, 125, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(27, 109, this.config.HEAD_SIZE, Math.PI / 2 - Math.PI / 12, Math.PI * 1.5 - Math.PI / 12, true);
+        this.g.lineTo(45, 102);
+        this.g.arc(45, 106, this.config.HEAD_SIZE, Math.PI * 1.5 - Math.PI / 12, Math.PI / 2 - Math.PI / 12, true);
+        this.g.lineTo(27, 113);
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(41, 82, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+        
+        // 画个球拍
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.arc(-32, 124, this.config.BAT_SIZE + 2, Math.PI - Math.PI / 4, Math.PI * 1.5 + Math.PI / 8, true);
+        this.g.bezierCurveTo(-31, 123, 0, 155, 40, 134);
+        this.g.arc(42, 138, this.config.BAT_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 + Math.PI / 8, true);
+        this.g.bezierCurveTo(45, 142, 0, 162, -37, 128);
+        // // this.g.close();
+        this.g.stroke();
+
+
+        // 画手臂
+        var handStart = cc.v2(52, 72);
+        var handEnd = cc.v2(53, 25);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 45, 55, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(29, 78);
+        var trousersEnd = cc.v2(51, 69);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(32, 71);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 10, 38, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(43, 67);
+        legEnd = cc.v2(64, 2);
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 62, 55, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_015:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(53, 104, this.config.HEAD_SIZE + 1, Math.PI / 2 - Math.PI / 12, Math.PI * 1.5 - Math.PI / 8, true);
+        this.g.lineTo(65, 96);
+        this.g.arc(66, 101, this.config.HEAD_SIZE + 1, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 - Math.PI / 8, true);
+        this.g.lineTo(49, 110);;
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(54, 78, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(45, 89);
+        var handEnd = cc.v2(70, 135);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 20, 128, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 1, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(55, 63);
+        var handEnd = cc.v2(56, 30);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 40, 40, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(41, 73);
+        var trousersEnd = cc.v2(63, 66);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(44, 67);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 30, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x - 6, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(57, 64);
+        legEnd = cc.v2(63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 40, legStart.y - 15, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_016:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(70, 101, this.config.HEAD_SIZE + 1, Math.PI / 2 - Math.PI / 12, Math.PI * 1.5 - Math.PI / 8, true);
+        this.g.lineTo(76, 92);
+        this.g.arc(77, 97, this.config.HEAD_SIZE + 1, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 - Math.PI / 8, true);
+        this.g.lineTo(71, 105);;
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(64, 75, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(60, 90);
+        var handEnd = cc.v2(102, 107);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 63, 140, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 4, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(64, 60);
+        var handEnd = cc.v2(60, 33);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 50, 40, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(50, 73);
+        var trousersEnd = cc.v2(70, 60);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(52, 64);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.lineTo(legEnd.x, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(68, 60);
+        legEnd = cc.v2(63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 38, legStart.y - 18, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_017:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(84, 92, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(66, 73, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(67, 88);
+        var handEnd = cc.v2(105, 90);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 94, 125, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 4, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(68, 59);
+        var handEnd = cc.v2(60, 33);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 50, 40, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(51, 72);
+        var trousersEnd = cc.v2(70, 60);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(53, 66);
+        var legEnd = cc.v2(0, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.lineTo(legEnd.x, legEnd.y);
+        this.g.stroke();
+
+        legStart = cc.v2(68, 57);
+        legEnd = cc.v2(63, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 38, legStart.y - 18, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_018:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+
+        // 画个脑袋
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(60, 86, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(43, 66, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(37, 78);
+        var handEnd = cc.v2(62, 110);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 20, 120, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x - 4, handEnd.y - 5, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(56, 61);
+        var handEnd = cc.v2(80, 25);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 70, 32, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(28, 61);
+        var trousersEnd = cc.v2(53, 55);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(33, 54);
+        var legEnd = cc.v2(6, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -15, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(0, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(51, 52);
+        legEnd = cc.v2(68, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, legStart.x + 38, legStart.y - 18, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+
+    serve_019:function() {
+        // 画脑袋
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        // this.g.ellipse(18, 116, 15, 5);
+        this.g.arc(37, 104, this.config.HEAD_SIZE + 2, Math.PI / 2 - Math.PI / 8, Math.PI * 1.5 - Math.PI / 8, true);
+        this.g.lineTo(44, 96);
+        this.g.arc(46, 101, this.config.HEAD_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 2 - Math.PI / 8, true);
+        this.g.lineTo(38, 110);
+        // // this.g.close();
+        // // this.g.stroke();
+        // // this.g.fill();
+
+        // 画个身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(32, 78, this.config.BODY_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(23, 88);
+        var handEnd = cc.v2(-12, 127);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, -23, 95, handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画个球拍
+        this.g.lineWidth = this.config.CIRCLE_WIDTH;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.circle(handEnd.x + 5, handEnd.y - 1, this.config.BAT_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 画手臂
+        var handStart = cc.v2(46, 81);
+        var handEnd = cc.v2(76, 49);
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(handStart.x, handStart.y);
+        this.g.bezierCurveTo(handStart.x, handStart.y, 75, 82, handEnd.x, handEnd.y);
+        // this.g.lineTo(handEnd.x, handEnd.y);
+        this.g.stroke();
+
+        // 画裤子
+        var trousersStart = cc.v2(19, 71);
+        var trousersEnd = cc.v2(42, 67);
+        this.g.moveTo(trousersStart.x, trousersStart.y);
+        this.g.lineTo(trousersEnd.x, trousersEnd.y);
+        this.g.stroke();
+
+        // 画腿
+        var legStart = cc.v2(22, 66);
+        var legEnd = cc.v2(6, 0)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, -10, 52, legEnd.x, legEnd.y);
+        this.g.lineTo(0, 0);
+        this.g.stroke();
+
+        legStart = cc.v2(38, 64);
+        legEnd = cc.v2(68, 1)
+        this.g.moveTo(legStart.x, legStart.y);
+        this.g.bezierCurveTo(legStart.x, legStart.y, 65, 55, legEnd.x, legEnd.y);
+        this.g.lineTo(legEnd.x + 6, legEnd.y);
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/actions/serve.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "60e04b1d-2204-4396-a49b-b9798872e2b3",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
assets/scripts/balls.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "b1de2748-35a4-4215-830f-585fdcb818d5",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 304 - 0
assets/scripts/balls/ball.js

@@ -0,0 +1,304 @@
+// 对手削球,从右侧到右侧
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        this.initValues();
+        this.initNodes();
+    },
+
+    start () {
+        this.rivalPeelLtoL();
+    },
+
+    // 初始化
+    initValues:function () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+
+        // 记录下节点
+        this.poses = new Array();
+        // 记录是否需要撞击的效果
+        this.showBump = false;
+    },
+
+    // 初始化子节点
+    initNodes:function() {
+        this.head = new cc.Node("");
+        this.head.setPosition(cc.v2(0, 0));
+        this.head.parent = this.node;
+    },
+
+    // 外部调用
+    // 球的运动停止
+    ballStop:function() {
+
+    },
+
+    // 我方接球,从左到左
+    minePatLToL:function() {
+        var beginPos = cc.v2(-103, -110);
+        var dropPos = cc.v2(-64, 144);
+        var endPos = cc.v2(-53, 313);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        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 self = this;
+        var move_01_end = cc.callFunc(function() {
+            self.bump(dropPos);
+        });
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02));
+    },
+
+    // 我方接球,从右到右
+    minePatRToR:function() {
+        var beginPos = cc.v2(52, -109);
+        var dropPos = cc.v2(71, 141);
+        var endPos = cc.v2(131, 309);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        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 self = this;
+        var move_01_end = cc.callFunc(function() {
+            self.bump(dropPos);
+        });
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02));
+    },
+
+    // 我方接球,从左到右
+    minePatLToR:function() {
+        var beginPos = cc.v2(-103, -76);
+        var dropPos = cc.v2(47, 140);
+        var endPos = cc.v2(221, 346);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        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 self = this;
+        var move_01_end = cc.callFunc(function() {
+            self.bump(dropPos);
+        });
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02));
+    },
+
+    // 我方削球,从右到右
+    minePeelRToR:function() {
+        var beginPos = cc.v2(148, -176);
+        var dropPos = cc.v2(79, 99);
+        var endPos = cc.v2(104, 319);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        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 self = this;
+        var move_01_end = cc.callFunc(function() {
+            self.bump(dropPos);
+        });
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02));
+    },
+
+    // 对手发球
+    rivalServer:function() {
+        var serverBegin = cc.v2(166, 290);
+        var beatPos = cc.v2(96, 274);
+        var dropPos = cc.v2(28, 144);
+        var jumpPos = cc.v2(-14, 21);
+        var endPos = cc.v2(-147, -161);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(serverBegin);
+
+        var bezier_01 = [serverBegin, cc.v2(125, 400), beatPos];
+        var bezier_02 = [beatPos, cc.v2(45, 250), dropPos];
+        var bezier_03 = [dropPos, cc.v2(0, 56), jumpPos];
+        var bezier_04 = [jumpPos, cc.v2(-80, 10), endPos];
+        
+        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+        var move_03 = cc.bezierTo(0.5, bezier_03);
+        var self = this;
+        var move_03_end = cc.callFunc(function() {
+            self.bump(jumpPos);
+        });
+        var move_04 = cc.bezierTo(0.5, bezier_04);
+        this.head.runAction(cc.sequence(move_01, move_02, move_03, move_03_end, move_04));
+    },
+
+    // 对手接球,从右到左
+    rivalPatRToL:function() {
+        var beginPos = cc.v2(112, 328);
+        var dropPos = cc.v2(-22, 16);
+        var endPos = cc.v2(-122, -182);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        var bezier_01 = [beginPos, cc.v2(45, 172), dropPos];
+        var bezier_02 = [dropPos, cc.v2(-120, -10), endPos];
+
+        var move_01 = cc.bezierTo(0.5, bezier_01);
+        var self = this;
+        var move_01_end = cc.callFunc(function() {
+            self.bump(dropPos);
+        });
+        var move_02 = cc.bezierTo(0.5, bezier_02);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02));
+    },
+
+    // 对手削球,从左到左
+    rivalPeelLtoL:function() {
+        var beginPos = cc.v2(-95, 263);
+        var centerPos = cc.v2(-75, 58);
+        var endPos = cc.v2(-66, -163);
+
+        // 将节点移动到指定位置
+        this.head.setPosition(beginPos);
+
+        var bezier_01 = [beginPos, cc.v2(-230, 410), centerPos];
+        var move_01 = cc.bezierTo(1, 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_end = cc.callFunc(function() {
+            cc.log ("动作 2 结束 ... ");
+        }, this);
+
+        this.head.runAction(cc.sequence(move_01, move_01_end, move_02, move_02_end));
+    },
+
+    // 球磕碰
+    bump:function(loc) {
+        this.bumpLoc = loc;
+        this.bumpTime = 0;
+
+        this.showBump = true;
+    },
+
+    // 绘图
+    draw:function(delay) {
+        this.g.clear();
+
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个头部
+        this.g.fillColor.fromHEX('#ff00000');
+        this.g.circle(this.head.x, this.head.y, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+        
+        var pos = this.poses[0];
+        this.g.lineWidth = 3;
+        this.g.moveTo(pos.x, pos.y)
+        for (var i = 0; i < this.poses.length; i++) {
+            var getPos = this.poses[i];
+            this.g.lineTo(getPos.x, getPos.y);
+        }
+
+        this.g.stroke();
+
+        // 当需要绘制撞击点时
+        if (this.showBump) {
+
+            this.bumpTime += delay;
+
+            var timeScale = 15;
+            var space = 1;
+            var low = 2.5;
+            var high = 10;
+
+            // 右上
+            this.g.lineWidth = 3;
+            this.g.moveTo(this.bumpLoc.x + space + this.bumpTime * timeScale * low, this.bumpLoc.y + space + this.bumpTime * timeScale * low);
+            this.g.lineTo(this.bumpLoc.x + space + this.bumpTime * timeScale * high, this.bumpLoc.y + space + this.bumpTime * timeScale * high)
+            this.g.stroke();
+
+            // 右下
+            this.g.lineWidth = 3;
+            this.g.moveTo(this.bumpLoc.x + space + this.bumpTime * timeScale * low, this.bumpLoc.y - space - this.bumpTime * timeScale * low);
+            this.g.lineTo(this.bumpLoc.x + space + this.bumpTime * timeScale * high, this.bumpLoc.y - space - this.bumpTime * timeScale * high)
+            this.g.stroke();
+
+            // 左上
+            this.g.lineWidth = 3;
+            this.g.moveTo(this.bumpLoc.x - space - this.bumpTime * timeScale * low, this.bumpLoc.y + space + this.bumpTime * timeScale * low);
+            this.g.lineTo(this.bumpLoc.x - space - this.bumpTime * timeScale * high, this.bumpLoc.y + space + this.bumpTime * timeScale * high)
+            this.g.stroke();
+
+            // 右下
+            this.g.lineWidth = 3;
+            this.g.moveTo(this.bumpLoc.x - space - this.bumpTime * timeScale * low, this.bumpLoc.y - space - this.bumpTime * timeScale * low);
+            this.g.lineTo(this.bumpLoc.x - space - this.bumpTime * timeScale * high, this.bumpLoc.y - space - this.bumpTime * timeScale * high)
+            this.g.stroke();
+
+            if (this.bumpTime > 0.1) {
+                this.showBump = false;
+            }
+        }
+    },
+
+    update (dt) {
+        // 记录当前的位置
+        var news = [this.head.position];
+        // 在结合当前的数组
+        this.poses = news.concat(this.poses);
+        // 如果数组长度大于20,则将最后一个删除
+        if (this.poses.length > 20) {
+            this.poses.pop();
+        }
+
+        this.draw(dt);
+
+        var beginPos = cc.v2(112, 328);
+        var dropPos = cc.v2(-22, 16);
+        var endPos = cc.v2(-122, -182);
+
+        // 画手臂
+        this.g.lineWidth = this.config.LINE_WIDTH;
+        this.g.moveTo(beginPos.x, beginPos.y);
+        this.g.bezierCurveTo(beginPos.x, beginPos.y, 45, 172, dropPos.x, dropPos.y);
+        this.g.bezierCurveTo(dropPos.x, dropPos.y, -120, -10, endPos.x, endPos.y);
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/ball.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "2cfa8211-7639-4806-8738-2c0eb93b24b9",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 66 - 0
assets/scripts/balls/bump.js

@@ -0,0 +1,66 @@
+// 球碰到桌子
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+
+    },
+
+    // 球磕碰
+    bump:function(loc) {
+        this.bumpLoc = loc;
+        this.bumpTime = 0;
+
+        this.schedule(this.bumpUpdate, 1 / 60.0);
+    },
+
+    // 磕碰动画
+    bumpUpdate:function(delay) {
+        this.g.clear();
+        this.bumpTime += delay;
+
+        var timeScale = 15;
+        var space = 1;
+        var low = 2.5;
+        var high = 10;
+
+        // 右上
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.bumpLoc.x + space + this.bumpTime * timeScale * low, this.bumpLoc.y + space + this.bumpTime * timeScale * low);
+        this.g.lineTo(this.bumpLoc.x + space + this.bumpTime * timeScale * high, this.bumpLoc.y + space + this.bumpTime * timeScale * high)
+        this.g.stroke();
+
+        // 右下
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.bumpLoc.x + space + this.bumpTime * timeScale * low, this.bumpLoc.y - space - this.bumpTime * timeScale * low);
+        this.g.lineTo(this.bumpLoc.x + space + this.bumpTime * timeScale * high, this.bumpLoc.y - space - this.bumpTime * timeScale * high)
+        this.g.stroke();
+
+        // 左上
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.bumpLoc.x - space - this.bumpTime * timeScale * low, this.bumpLoc.y + space + this.bumpTime * timeScale * low);
+        this.g.lineTo(this.bumpLoc.x - space - this.bumpTime * timeScale * high, this.bumpLoc.y + space + this.bumpTime * timeScale * high)
+        this.g.stroke();
+
+        // 右下
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.bumpLoc.x - space - this.bumpTime * timeScale * low, this.bumpLoc.y - space - this.bumpTime * timeScale * low);
+        this.g.lineTo(this.bumpLoc.x - space - this.bumpTime * timeScale * high, this.bumpLoc.y - space - this.bumpTime * timeScale * high)
+        this.g.stroke();
+
+        if (this.bumpTime > 0.1) {
+            this.unschedule(this.bumpUpdate);
+        }
+    },
+});

+ 9 - 0
assets/scripts/balls/bump.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "6a55f451-9442-43d9-bb83-0e58fe2aa72b",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 111 - 0
assets/scripts/balls/minepatltol.js

@@ -0,0 +1,111 @@
+// 我方接球,从我方左侧至敌方左侧
+
+var Bump = require("bump")
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+ 
+        // 球的运动区间
+        this.flyLeft = -101;
+        this.flyRight = -65;
+        this.flipRight = -30;
+
+        // 配置方程式的各项数据
+        // 飞翔时候的数据
+        this.flyX = 0;
+        this.flyY = 530;
+        this.flyDown = 6.2;
+
+        // 弹起来时候的数据
+        this.flipX = 0;
+        this.flipY = 759;
+        this.flipDown = 9.8;
+    },
+
+    // update (dt) {},
+
+    // 发球时的方程式
+    equation:function(x) {
+        // return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+        
+        if (x >= this.flyLeft - 10 && x <= this.flyRight) {
+            return x * this.flyDown + this.flyY;
+        } else if (x > this.flyRight && x <= this.flipRight) {
+            return (x * this.flipDown) + this.flipY;
+        }
+
+        return x * this.flyDown + this.flyY;
+    },
+
+    ballPat:function() {
+        this.unschedule(this.patUpdate);
+        this.x = this.flyLeft;
+        this.schedule(this.patUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.patUpdate);
+    },
+    
+    patUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+        if (this.x >= this.flyLeft - 10 && this.x < this.flyRight) {
+            speed = 2;
+            state = s.ballconfig.BALL_STATE_MINE_LEFT_TO_LEFT_FLY;
+        } else if (this.x >= this.flyRight && this.x < this.flipRight) {
+            speed = 2;
+            state = this.ballconfig.BALL_STATE_MINE_LEFT_TO_LEFT_FLIP;
+        } else if (this.x >= this.flipRight) {
+            speed = 2;
+            state = this.ballconfig.BALL_STATE_DROP_IN_RIVAL;
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x + speed;
+        if (this.x < this.flyRight && next >= this.flyRight) {
+            cc.log ("到了中间 ... ");
+            this.bump.bump(cc.v2(this.x, this.equation(this.x)));
+        }
+
+        // cc.log ("x = " + this.x + " mid = " + this.flyRight + " x = " + next);
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.equation(this.x));
+        this.g.bezierCurveTo(this.x, this.equation(this.x), this.x - 5, this.equation(this.x - 5), this.x - 10, this.equation(this.x - 10));
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/minepatltol.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "fcb46293-c5fb-4ecc-9bed-0ab61c04cd21",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 108 - 0
assets/scripts/balls/minepatltor.js

@@ -0,0 +1,108 @@
+// 我方接球,从我方左侧至敌方右侧
+
+var Bump = require("bump")
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+
+        // 球的运动区间
+        this.flyLeft = -71;
+        this.flyRight = 40;
+        this.flipRight = 218;
+
+        // 配置方程式的各项数据
+        // 飞翔时候的数据
+        this.flyX = 195;
+        this.flyY = 230;
+        this.flyDown = -250;
+
+        // 弹起来时候的数据
+        this.flipX = 183;
+        this.flipY = 349;
+        this.flipDown = -94;
+    },
+
+    // update (dt) {},
+
+    // 发球时的方程式
+    equation:function(x) {
+        // return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+        
+        if (x >= this.flyLeft - 10 && x <= this.flyRight) {
+            return (x * x - this.flyX * 2 * x + this.flyX * this.flyX) / this.flyDown + this.flyY;
+        } else if (x > this.flyRight && x <= this.flipRight) {
+            return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+        }
+
+        return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+    },
+
+    ballPat:function() {
+        this.unschedule(this.patUpdate);
+        this.x = this.flyLeft;
+        this.schedule(this.patUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.patUpdate);
+    },
+    
+    patUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+        if (this.x >= this.flyLeft - 10 && this.x < this.flyRight) {
+            speed = 10;
+            state = this.ballconfig.BALL_STATE_MINE_LEFT_TO_RIGHT_FLY;
+        } else if (this.x >= this.flyRight && this.x < this.flipRight) {
+            speed = 10;
+            state = this.ballconfig.BALL_STATE_MINE_LEFT_TO_RIGHT_FLIP;
+        } else if (this.x >= this.flipRight) {
+            speed = 10;
+            state = this.ballconfig.BALL_STATE_DROP_IN_RIVAL;
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x + speed;
+        if (this.x < this.flyRight && next > this.flyRight) {
+            this.bump.bump(cc.v2(this.x, this.equation(this.x)));
+        }
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.equation(this.x));
+        this.g.bezierCurveTo(this.x, this.equation(this.x), this.x - 5, this.equation(this.x - 5), this.x - 10, this.equation(this.x - 10));
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/minepatltor.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "1c3b5df5-6905-43ea-bc7d-7940cdd77f0d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 41 - 0
assets/scripts/balls/minepatrtol.js

@@ -0,0 +1,41 @@
+// Learn cc.Class:
+//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html
+//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html
+// Learn Attribute:
+//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
+//  - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html
+// Learn life-cycle callbacks:
+//  - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
+//  - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        // foo: {
+        //     // ATTRIBUTES:
+        //     default: null,        // The default value will be used only when the component attaching
+        //                           // to a node for the first time
+        //     type: cc.SpriteFrame, // optional, default is typeof default
+        //     serializable: true,   // optional, default is true
+        // },
+        // bar: {
+        //     get () {
+        //         return this._bar;
+        //     },
+        //     set (value) {
+        //         this._bar = value;
+        //     }
+        // },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+
+    },
+
+    // update (dt) {},
+});

+ 9 - 0
assets/scripts/balls/minepatrtol.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "60162872-2073-4b80-9f23-dd5a5ad97108",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 102 - 0
assets/scripts/balls/minepatrtor.js

@@ -0,0 +1,102 @@
+// 我方接球,从我方右侧至敌方右侧
+
+var Bump = require("bump")
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+
+        // 球的运动区间
+        this.flyLeft = 54;
+        this.flyRight = 69;
+        this.flipRight = 120;
+
+        // 配置方程式的各项数据
+        // 飞翔时候的数据
+        this.flyX = 0;
+        this.flyY = -860;
+        this.flyDown = 14.2;
+
+        // 弹起来时候的数据
+        this.flipX = 0;
+        this.flipY = -340;
+        this.flipDown = 6.8;
+    },
+
+    // update (dt) {},
+
+    // 发球时的方程式
+    equation:function(x) {        
+        if (x >= this.flyLeft - 10 && x <= this.flyRight) {
+            return x * this.flyDown + this.flyY;
+        } else if (x > this.flyRight && x <= this.flipRight) {
+            return x * this.flipDown + this.flipY;
+        }
+
+        return x * this.flipDown + this.flipY;
+    },
+
+    ballPat:function() {
+        this.unschedule(this.patUpdate);
+        this.x = this.flyLeft;
+        this.schedule(this.patUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.patUpdate);
+    },
+    
+    patUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+        if (this.x >= this.flyLeft - 10 && this.x < this.flyRight) {
+            speed = 1;
+            state = this.ballconfig.BALL_STATE_MINE_RIGHT_TO_RIGHT_FLY;
+        } else if (this.x >= this.flyRight && this.x < this.flipRight) {
+            speed = 1;
+            state = this.ballconfig.BALL_STATE_MINE_RIGHT_TO_RIGHT_FLIP;
+        } else if (this.x >= this.flipRight) {
+            speed = 1;
+            state = this.ballconfig.BALL_STATE_DROP_IN_RIVAL;
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x + speed;
+        if (this.x < this.flyRight && next >= this.flyRight) {
+            this.bump.bump(cc.v2(this.x, this.equation(this.x)));
+        }
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.equation(this.x));
+        this.g.bezierCurveTo(this.x, this.equation(this.x), this.x - 5, this.equation(this.x - 5), this.x - 10, this.equation(this.x - 10));
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/minepatrtor.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "68dfb62e-e6f5-417f-9f5f-c738754e3775",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 126 - 0
assets/scripts/balls/minepeelrtor.js

@@ -0,0 +1,126 @@
+// 我方削球,从右侧到右侧
+
+// 角色的方向
+var Peel_State = cc.Enum ({
+    Peel_Fly: 1,
+    Peel_Flip: 2
+});
+
+var Bump = require("bump")
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+
+        this.state = Peel_State.Peel_Fly;
+
+        // 球的运动区间
+        this.flyRight = 159;
+        this.flyLeft = 78;
+        this.flipRight = 109;
+
+        // 配置方程式的各项数据
+        // 飞翔时候的数据
+        this.flyX = 75;
+        this.flyY = 105;
+        this.flyDown = -25;
+
+        // 弹起来时候的数据
+        this.flipX = 0;
+        this.flipY = -800;
+        this.flipDown = 11.8;
+    },
+
+    // 发球时的方程式
+    equation:function(x) {
+        if (this.state == Peel_State.Peel_Fly) {  
+            return (x * x - this.flyX * 2 * x + this.flyX * this.flyX) / this.flyDown + this.flyY;
+        } else {
+            return x * this.flipDown + this.flipY;
+        }
+
+        return 0;
+    },
+
+    ballPeel:function() {
+        this.unschedule(this.peelUpdate);
+        this.x = this.flyRight;
+        this.schedule(this.peelUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.peelUpdate);
+    },
+    
+    peelUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+
+        if (this.state == Peel_State.Peel_Fly) {
+            if (this.x >= this.flyLeft) {
+                speed = -2;
+                state = this.ballconfig.BALL_STATE_MINE_RIGHT_TO_RIGHT_FLY;
+            } else {
+                this.state = Peel_State.Peel_Flip;
+            }
+        } else {
+            if (this.x <= this.flipRight) {
+                speed = 1;
+                state = this.ballconfig.BALL_STATE_MINE_RIGHT_TO_RIGHT_FLIP;
+            } else {
+                speed = 1;
+                state = this.ballconfig.BALL_STATE_DROP_IN_RIVAL;
+            }
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x + speed;
+        if (this.x < this.flyRight && next >= this.flyRight) {
+            this.bump.bump(cc.v2(this.x, this.equation(this.x)));
+        }
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.equation(this.x));
+        if (this.state == Peel_State.Peel_Fly) {
+            this.g.bezierCurveTo(this.x, this.equation(this.x), this.x - 5, this.equation(this.x - 5), this.x - 10, this.equation(this.x - 10));
+        } else {
+            this.g.bezierCurveTo(this.x, this.equation(this.x), this.x + 1, this.equation(this.x + 1), this.x + 2, this.equation(this.x + 2));
+        }
+
+        this.g.stroke();
+    },
+
+    // update (dt) {},
+});

+ 9 - 0
assets/scripts/balls/minepeelrtor.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "30a8114a-79ca-4dd4-acd6-c716a4c93554",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 108 - 0
assets/scripts/balls/rivalpatrtol.js

@@ -0,0 +1,108 @@
+// 敌方接球,从地方右侧至敌方左侧
+
+var Bump = require("bump")
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+ 
+        // 球的运动区间
+        this.flyRight = 123;
+        this.flyLeft = -21;
+        this.flipLeft = -140;
+
+        // 配置方程式的各项数据
+        // 飞翔时候的数据
+        this.flyX = 0;
+        this.flyY = 70;
+        this.flyDown = 2.35;
+
+        // 弹起来时候的数据
+        this.flipX = -5;
+        this.flipY = 25;
+        this.flipDown = -80;
+    },
+
+    // update (dt) {},
+
+    // 发球时的方程式
+    equation:function(x) {
+        // return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+        
+        if (x <= this.flyRight + 10 && x > this.flyLeft) {
+            return x * this.flyDown + this.flyY;
+        } else if (x <= this.flyLeft && x > this.flipLeft) {
+            return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+        }
+
+        return (x * x - this.flipX * 2 * x + this.flipX * this.flipX) / this.flipDown + this.flipY;
+    },
+
+    ballPat:function() {
+        this.unschedule(this.patUpdate);
+        this.x = this.flyRight;
+        this.schedule(this.patUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.patUpdate);
+    },
+    
+    patUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+        if (this.x <= this.flyRight + 10 && this.x > this.flyLeft) {
+            speed = 7;
+            state = this.ballconfig.BALL_STATE_RIVAL_RIGHT_TO_LEFT_FLY;
+        } else if (this.x <= this.flyLeft && this.x > this.flipLeft) {
+            speed = 5;
+            state = this.ballconfig.BALL_STATE_RIVAL_RIGHT_TO_LEFT_FLIP;
+        } else if (this.x <= this.flipLeft) {
+            speed = 5;
+            state = this.ballconfig.BALL_STATE_DROP_IN_MINE;
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x - speed;
+        if (this.x > this.flyLeft && next <= this.flyLeft) {
+            this.bump.bump(cc.v2(this.x, this.equation(this.x)));
+        }
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.equation(this.x));
+        this.g.bezierCurveTo(this.x, this.equation(this.x), this.x - 5, this.equation(this.x - 5), this.x - 10, this.equation(this.x - 10));
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/rivalpatrtol.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "c17c11b2-314b-4e54-bb9b-28a856d965f2",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 110 - 0
assets/scripts/balls/rivalpeelrtor.js

@@ -0,0 +1,110 @@
+// 对手削球,从右侧到右侧
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        this.initValues();
+        this.initNodes();
+    },
+
+    start () {
+        this.initActions();
+    },
+
+    // 初始化
+    initValues:function () {
+        // 配置绘制的数据
+        // 从配置中心获取数据
+        this.config = require ("gameconfig")
+        // 配置绘制组件
+        this.g = this.getComponent(cc.Graphics);
+
+        // 记录下节点
+        this.poses = new Array();
+        this.beginPos = cc.v2(-95, 263);
+        this.centerPos = cc.v2(-75, 58);
+        this.endPos = cc.v2(-66, -163);
+    },
+
+    // 初始化子节点
+    initNodes:function() {
+        this.head = new cc.Node("");
+        this.head.setPosition(this.beginPos);
+        this.head.parent = this.node;
+    },
+
+    // 初始化头部节点的运动
+    initActions:function() {
+        var bezier_01 = [this.beginPos, cc.v2(-230, 410), this.centerPos];
+        var move_01 = cc.bezierTo(1, bezier_01);
+        var move_01_End = cc.callFunc(this.move_01_End, this);
+        var bezier_02 = [this.centerPos, cc.v2(-125, 40), this.endPos];
+        var move_02 = cc.bezierTo(1, bezier_02);
+        var move_02_End = cc.callFunc(this.move_02_End, this);
+
+        this.head.runAction(cc.sequence(move_01, move_01_End, move_02, move_02_End));
+    },
+
+    // 第一步动作结束
+    move_01_End:function() {
+        cc.log ("Move 01 End ... ")
+    },
+
+    // 第二部动作结束
+    move_02_End:function() {
+        cc.log ("Move 02 End ... ")
+    },
+
+    // 外部调用
+    ballStop:function() {
+
+    },
+
+    // 
+
+    // 绘图
+    draw:function() {
+        this.g.clear();
+
+        // 画脑袋和身体
+        this.g.lineWidth = this.config.CIRCLE_WIDTH
+
+        // 画个头部
+        this.g.fillColor.fromHEX('#ff00000');
+        this.g.circle(this.head.x, this.head.y, this.config.HEAD_SIZE);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+        
+        var pos = this.poses[0];
+        this.g.lineWidth = 3;
+        this.g.moveTo(pos.x, pos.y)
+        for (var i = 0; i < this.poses.length; i++) {
+            var getPos = this.poses[i];
+            this.g.lineTo(getPos.x, getPos.y);
+        }
+
+        this.g.stroke();
+
+    },
+
+    update (dt) {
+        // 记录当前的位置
+        var news = [this.head.position];
+        // 在结合当前的数组
+        this.poses = news.concat(this.poses);
+        // 如果数组长度大于20,则将最后一个删除
+        if (this.poses.length > 20) {
+            this.poses.pop();
+        }
+
+        this.draw();
+    },
+});

+ 9 - 0
assets/scripts/balls/rivalpeelrtor.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "e90ebd4a-b013-437d-8a8d-21dd4192b53e",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 148 - 0
assets/scripts/balls/rivalserve.js

@@ -0,0 +1,148 @@
+// 对手发球的运动
+var Bump = require("bump")
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+
+        bump: {
+            default: null,
+            type: Bump,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.initValues();
+    },
+
+    // 初始化数据
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+        // 球的动作
+
+        // 发球开始的区间
+        this.serveStartRight = 167;
+        this.serveStartLeft = 105;
+
+        // 发球右的区间
+        this.serveRightLeft = 28;
+        // 发球中的区间
+        this.serveMidLeft = -10;
+        // 发球左的区间
+        this.serveLeftLeft = -100;
+
+        // 配置方程式的各项数据
+        // 发球时数据
+        this.serveStartX = 135;
+        this.serveStartY = 350;
+        this.serveStartDown = -30;
+
+        // 发球时右边位置数据
+        this.serveRightX = 118;
+        this.serveRightY = 285;
+        this.serveRightDown = -45;
+
+        // 发球时中间位置数据
+        this.serveMidX = 118;
+        this.serveMidY = 190;
+        this.serveMidDown = -95;
+
+        // 发球时左侧的位置数据
+        this.serveLeftX = 0;
+        this.serveLeftY = 18;
+        this.serveLeftDown = -92;
+
+        this.g.lineWidth = 4;
+        this.g.fillColor.fromHEX('#ffffff');
+
+        this.x = this.serveStartRight;
+    },
+
+    ballServe:function() {
+        this.unschedule(this.ballUpdate);
+        this.x = this.serveStartRight;
+        this.schedule(this.ballUpdate, 1.0 / 60);
+    },
+
+    ballStop:function() {
+        this.unschedule(this.ballUpdate);
+    },
+
+    ballUpdate:function (dt) {
+        this.g.clear();
+
+        var speed = 0;
+        var state;
+        if (this.x <= this.serveStartRight + 10 && this.x >= this.serveStartLeft) {
+            speed = 1.309;
+            state = this.ballconfig.BALL_STATE_SERVE_START;
+        } else if (this.x < this.serveStartLeft  && this.x >= this.serveRightLeft) {
+            speed = 12;
+            state = this.ballconfig.BALL_STATE_SERVE_RIGHT;
+        } else if (this.x < this.serveRightLeft && this.x >= this.serveMidLeft) {
+            speed = 9;
+            state = this.ballconfig.BALL_STATE_SERVE_MID;
+        } else if (this.x < this.serveMidLeft && this.x >= this.serveLeftLeft) {
+            speed = 8;
+            state = this.ballconfig.BALL_STATE_SERVE_LEFT;
+        } else {
+            speed = 8;
+            state = this.ballconfig.BALL_STATE_DROP_IN_MINE;
+        }
+
+        if (this.stateCallback != null) {
+            // 给控制器传递发球左侧的状态
+            this.stateCallback(state);
+        }
+
+        // 判断是否需要磕碰
+        var next = this.x - speed;
+        if (this.x > this.serveMidLeft && next < this.serveMidLeft) {
+            this.bump.bump(cc.v2(this.x, this.serveEquation(this.x)));
+        }
+
+        this.x = next;
+
+        this.g.lineWidth = 3;
+        this.g.moveTo(this.x, this.serveEquation(this.x));
+        this.g.bezierCurveTo(this.x, this.serveEquation(this.x), this.x + 5, this.serveEquation(this.x + 5), this.x + 10, this.serveEquation(this.x + 10));
+        this.g.stroke();
+    },
+
+    // 发球时的方程式
+    serveEquation:function(x) {
+        // 判断各个不同的区间
+        if (x <= this.serveStartRight + 10 && x >= this.serveStartLeft) {
+            return (x * x - this.serveStartX * 2 * x + this.serveStartX * this.serveStartX) / this.serveStartDown + this.serveStartY;
+        } else if (x < this.serveStartLeft  && x >= this.serveRightLeft) {
+            return (x * x - this.serveRightX * 2 * x + this.serveRightX * this.serveRightX) / this.serveRightDown + this.serveRightY;
+        } else if (x < this.serveRightLeft && x >= this.serveMidLeft) {
+            return (x * x - this.serveMidX * 2 * x + this.serveMidX * this.serveMidX) / this.serveMidDown + this.serveMidY;
+        }
+
+        return (x * x - this.serveLeftX * 2 * x + this.serveLeftX * this.serveLeftX) / this.serveLeftDown + this.serveLeftY;
+        // return 0;
+    },
+
+    // 绘制坐标线
+    drawAxle:function() {
+        this.g.lineWidth = 2;
+        this.g.moveTo(-1000, 0);
+        this.g.lineTo(1000, 0);
+        this.g.stroke();
+
+        this.g.moveTo(0, -1000);
+        this.g.lineTo(0, 1000);
+        this.g.stroke();
+    },
+});

+ 9 - 0
assets/scripts/balls/rivalserve.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "6e6459f8-4156-4f20-993f-47147fa2fcd9",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
assets/scripts/configs.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "c14e13d4-16ea-4ae8-959e-cca08f470350",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 26 - 0
assets/scripts/configs/ballconfig.js

@@ -0,0 +1,26 @@
+// 配置游戏中的各种数据
+module.exports = {
+    // 什么都没有的状态
+    BALL_STATE_NONE: 0,
+    // 发球时候的状态
+    BALL_STATE_SERVE_START: 1,
+    BALL_STATE_SERVE_RIGHT: 2,
+    BALL_STATE_SERVE_MID: 3,
+    BALL_STATE_SERVE_LEFT: 4,
+
+    // 我方接球时候的状态
+    BALL_STATE_MINE_LEFT_TO_RIGHT_FLY: 5,
+    BALL_STATE_MINE_LEFT_TO_RIGHT_FLIP: 6,
+    BALL_STATE_MINE_LEFT_TO_LEFT_FLY: 7,
+    BALL_STATE_MINE_LEFT_TO_LEFT_FLIP: 8,
+    BALL_STATE_MINE_RIGHT_TO_RIGHT_FLY: 9,
+    BALL_STATE_MINE_RIGHT_TO_RIGHT_FLIP: 10,
+
+    // 敌方接球时候的状态
+    BALL_STATE_RIVAL_RIGHT_TO_LEFT_FLY: 11,
+    BALL_STATE_RIVAL_RIGHT_TO_LEFT_FLIP: 12,
+
+    // 结束后的状态
+    BALL_STATE_DROP_IN_MINE: 100,
+    BALL_STATE_DROP_IN_RIVAL: 101,
+}

+ 9 - 0
assets/scripts/configs/ballconfig.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "6fb0d5e4-87ad-4914-8a6e-7459ebc53ccc",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 9 - 0
assets/scripts/gameconfig.js

@@ -0,0 +1,9 @@
+// 配置游戏中的各种数据
+module.exports = {
+    HEAD_SIZE: 4,       // 头的半径
+    BODY_SIZE: 12,      // 身体的半径
+    BAT_SIZE: 3,        // 球拍的半径
+
+    LINE_WIDTH: 4,     // 线的宽度
+    CIRCLE_WIDTH: 7,   // 圆的宽度
+}

+ 9 - 0
assets/scripts/gameconfig.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "b24fc288-df07-43e4-bacf-fc2258e8721e",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 7 - 0
assets/scripts/main.meta

@@ -0,0 +1,7 @@
+{
+  "ver": "1.0.1",
+  "uuid": "32eebe78-04eb-4def-b16e-5eaec697cf42",
+  "isSubpackage": false,
+  "subpackageName": "",
+  "subMetas": {}
+}

+ 113 - 0
assets/scripts/main/mainctrl.js

@@ -0,0 +1,113 @@
+// Scene的控制器
+// 管理角色和球的信息
+var Role = require("role")
+var RivalServe = require("rivalserve")
+var MinePatLtoR = require("minepatltor")
+var MinePatLtoL = require("minepatltol")
+var MinePatRtoR = require("minepatrtor")
+var RivalPatRtoL = require("rivalpatrtol")
+var MinePeelRtoR = require("minepeelrtor")
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        rival: {
+            default: null,
+            type: Role,
+        },
+
+        mine: {
+            default: null,
+            type: Role,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        var self = this;
+        this.rival.serveStart = function() {
+            // self.rivalserve.ballServe();
+        }
+
+        this.initValues();
+        this.initListener();
+
+        // 游戏开始,对方开始发球
+        this.rival.roleServe();
+    },
+
+    // 帧序列,在这里面处理各种状态
+    update (dt) {
+
+        if (this.ballstate == this.ballconfig.BALL_STATE_MINE_LEFT_TO_RIGHT_FLIP) {
+            this.rival.setDir(4);
+            this.stopAllBall();
+            this.rivalpatrtol.ballPat();
+            this.rival.pat.pat();
+
+            this.ballstate = this.ballconfig.BALL_STATE_NONE;
+        }
+    },
+
+    // 初始化数据
+    initValues:function() {
+        // 球的状态信息
+        this.ballconfig = require("ballconfig");
+        // 当前球的状态,初始化为发球开始状态
+        this.ballstate = this.ballconfig.BALL_STATE_SERVE_START;
+    },
+
+    // 初始化监听
+    initListener:function() {
+        // 添加触摸开始事件
+        var self = this;
+        this.node.on (cc.Node.EventType.TOUCH_START, function(event) {
+            self.mine.pat.pat();
+
+            var touches = event.getTouches();
+            var loc = self.node.convertToNodeSpaceAR(touches[0].getLocation());
+
+            if (loc.x > 0) {
+                self.mine.setDir(2);
+            } else {
+                self.mine.setDir(1);
+            }
+
+            // 如果状态符合,则打回去
+            if (self.ballstate == self.ballconfig.BALL_STATE_SERVE_LEFT ||
+                self.ballstate == self.ballconfig.BALL_STATE_RIVAL_RIGHT_TO_LEFT_FLIP) {
+                self.stopAllBall();
+                self.minepatltor.ballPat();
+            }
+        });
+
+        // // 配置球的状态判断回调
+        // this.rivalserve.stateCallback = function(state) {
+        //     self.ballstate = state;
+        // };
+        // this.minepatltor.stateCallback = function(state) {
+        //     self.ballstate = state;
+        // };
+        // this.minepatltol.stateCallback = function(state) {
+        //     self.ballstate = state;
+        // };
+        // this.minepatrtor.stateCallback = function(state) {
+        //     self.ballstate = state;
+        // };
+        // this.rivalpatrtol.stateCallback = function(state) {
+        //     self.ballstate = state;
+        // };
+    },
+
+    // 停止各种球的运动
+    stopAllBall:function() {
+        // this.rivalpatrtol.ballStop();
+        // this.minepatltor.ballStop();
+        // this.minepatltol.ballStop();
+        // this.minepatrtor.ballStop();
+    },
+});

+ 9 - 0
assets/scripts/main/mainctrl.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "fdb9ac58-9d56-4798-8af2-21ba746aa76d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 105 - 0
assets/scripts/role.js

@@ -0,0 +1,105 @@
+// 角色类,管理各个动作
+var Serve = require("serve")
+var Pat = require("pat")
+var Idle = require("idle")
+var Peel = require("peel")
+
+// 角色的方向
+var RoleDir = cc.Enum ({
+    Role_Mine_Left: 1,
+    Role_Mine_Right: 2,
+    Role_Rival_Left: 3,
+    Role_Rival_Right: 4
+});
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        // 发球组件
+        serve: {
+            default: null,
+            type: Serve, 
+        },
+        // 接球组件
+        pat: {
+            default: null,
+            type: Pat,
+        },
+
+        // 等待组件
+        idle: {
+            default: null,
+            type: Idle,
+        },
+
+        // 削球组件
+        peel: {
+            default: null,
+            type: Peel,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        this.initBlocks();
+        this.initValues();
+    },
+
+    start () {
+        this.idle.idle();
+    },
+
+    // update (dt) {},
+
+    // 初始化
+    // 初始化数据
+    initValues:function() {
+        this.mineLeft = cc.v2(-137, -176);
+        this.mineRight = cc.v2(29, -176);
+
+        this.rivalLeft = cc.v2(-10, 180);
+        this.rivalRight = cc.v2(138, 180);
+    },
+    
+    // 初始化各个组件的回调
+    initBlocks:function () {
+        var self = this;
+        // 开始发球的回调
+        this.serve.actionStart = function() {
+            if (self.serveStart != null) {
+                self.serveStart();
+            }
+        }
+
+        // 发球结束的回调
+        this.serve.actionEnd = function() {
+            self.idle.idle();
+        };
+
+        // 接球结束的回调
+        this.pat.actionEnd = function() {
+            self.idle.idle();
+        };
+    },
+
+    // 外部调用
+    // 设置位置
+    setDir:function(dir) {
+        if (dir == RoleDir.Role_Mine_Left) {
+            this.node.setPosition(this.mineLeft);
+        } else if (dir == RoleDir.Role_Mine_Right) {
+            this.node.setPosition(this.mineRight);
+        } else if (dir == RoleDir.Role_Rival_Left) {
+            this.node.setPosition(this.rivalLeft);
+        } else if (dir == RoleDir.Role_Rival_Right) {
+            this.node.setPosition(this.rivalRight);
+        }
+    },
+
+    // 发球
+    roleServe:function() {
+        this.serve.serve();
+    },
+});

+ 9 - 0
assets/scripts/role.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "8fad4c7b-76e8-4674-a2ff-8c4a83ea8e9a",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 81 - 0
assets/scripts/table.js

@@ -0,0 +1,81 @@
+// 绘制球桌
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        g: {
+            default: null,
+            type: cc.Graphics,
+        },
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {},
+
+    start () {
+        this.darwTable();
+    },
+
+    // 绘制球桌
+    darwTable:function() {
+        // 台面
+        this.g.lineWidth = 8;
+        this.g.fillColor.fromHEX('#ffffff');
+        this.g.moveTo(0, 0);
+        this.g.lineTo(-90, 0);
+        this.g.lineTo(-90, 168);
+        this.g.lineTo(90, 168);
+        this.g.lineTo(90, 0);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 桌角
+        this.g.lineWidth = 5;
+        this.g.moveTo(-79, 0);
+        this.g.lineTo(-79, -44);
+        this.g.stroke();
+
+        this.g.moveTo(79, 0);
+        this.g.lineTo(79, -44);
+        this.g.stroke();
+
+        // 中线
+        this.g.moveTo(0, 0);
+        this.g.lineTo(0, 168);
+        this.g.stroke();
+
+        // 中网
+        this.g.lineWidth = 8;
+        this.g.moveTo(-99, 84);
+        this.g.lineTo(-99, 103);
+        this.g.lineTo(99, 103);
+        this.g.lineTo(99, 84);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        // 网架
+        this.g.lineWidth = 8;
+        this.g.moveTo(-94, 76);
+        this.g.lineTo(-104, 76);
+        this.g.lineTo(-104, 108);
+        this.g.lineTo(-102, 108);
+        this.g.lineTo(-102, 80);
+        this.g.lineTo(-94, 80);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+
+        this.g.moveTo(94, 76);
+        this.g.lineTo(104, 76);
+        this.g.lineTo(104, 108);
+        this.g.lineTo(102, 108);
+        this.g.lineTo(102, 80);
+        this.g.lineTo(94, 80);
+        this.g.close();
+        this.g.stroke();
+        this.g.fill();
+    },
+});

+ 9 - 0
assets/scripts/table.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "76b41047-a66b-469e-9ba4-671d006f6de8",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 1 - 1
settings/builder.json

@@ -37,7 +37,7 @@
   },
   "startScene": "a2a270bb-bc4e-4b91-817e-c6d365ee1292",
   "title": "PingPongPro",
-  "webOrientation": "auto",
+  "webOrientation": "portrait",
   "wechatgame": {
     "REMOTE_SERVER_ROOT": "",
     "appid": "wx6ac3f5090a6b99c5",

+ 21 - 21
settings/project.json

@@ -1,35 +1,35 @@
 {
-  "start-scene": "current",
-  "group-list": [
-    "default"
-  ],
+  "assets-sort-type": "name",
   "collision-matrix": [
     [
       true
     ]
   ],
+  "design-resolution-height": 960,
+  "design-resolution-width": 544,
   "excluded-modules": [],
-  "last-module-event-record-time": 0,
-  "design-resolution-width": 960,
-  "design-resolution-height": 640,
-  "fit-width": false,
-  "fit-height": true,
-  "use-project-simulator-setting": false,
-  "simulator-orientation": false,
-  "use-customize-simulator": false,
-  "simulator-resolution": {
-    "width": 960,
-    "height": 640
-  },
-  "assets-sort-type": "name",
   "facebook": {
-    "enable": false,
     "appID": "",
-    "live": {
+    "audience": {
       "enable": false
     },
-    "audience": {
+    "enable": false,
+    "live": {
       "enable": false
     }
-  }
+  },
+  "fit-height": true,
+  "fit-width": false,
+  "group-list": [
+    "default"
+  ],
+  "last-module-event-record-time": 0,
+  "simulator-orientation": false,
+  "simulator-resolution": {
+    "height": 640,
+    "width": 960
+  },
+  "use-customize-simulator": true,
+  "use-project-simulator-setting": false,
+  "start-scene": "current"
 }

Fichier diff supprimé car celui-ci est trop grand
+ 32 - 15
settings/services.json