peel.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. // 削球的动作
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. loc: 0, // 代表方向,0为正位,1为反位
  6. },
  7. // LIFE-CYCLE CALLBACKS:
  8. onLoad () {
  9. // 配置绘制的数据
  10. // 从配置中心获取数据
  11. this.config = require ("gameconfig")
  12. // 配置绘制组件
  13. this.g = this.getComponent(cc.Graphics);
  14. // 配置方向
  15. if (this.loc == 0) {
  16. this.dir = 1;
  17. } else {
  18. this.dir = -1;
  19. }
  20. this.index = 1;
  21. },
  22. // start () {},
  23. peel_001:function() {
  24. // 画脑袋和身体
  25. this.g.lineWidth = this.config.CIRCLE_WIDTH
  26. // 画个脑袋
  27. this.g.fillColor.fromHEX('#ffffff');
  28. this.g.circle(this.dir * -7, 115, this.config.HEAD_SIZE);
  29. this.g.close();
  30. this.g.stroke();
  31. this.g.fill();
  32. // 画个身体
  33. this.g.fillColor.fromHEX('#ffffff');
  34. this.g.circle(this.dir * -20, 90, this.config.BODY_SIZE);
  35. this.g.close();
  36. this.g.stroke();
  37. this.g.fill();
  38. // 画手臂
  39. var handStart = cc.v2(this.dir * -7, 95);
  40. var handEnd = cc.v2(this.dir * 14, 50);
  41. this.g.lineWidth = this.config.LINE_WIDTH;
  42. this.g.moveTo(handStart.x, handStart.y);
  43. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 3, 60, handEnd.x, handEnd.y);
  44. this.g.stroke();
  45. // 画个球拍
  46. this.g.lineWidth = this.config.CIRCLE_WIDTH
  47. this.g.fillColor.fromHEX('#ffffff');
  48. this.g.circle(handEnd.x + this.dir * 3, handEnd.y + 2, this.config.BAT_SIZE);
  49. this.g.close();
  50. this.g.stroke();
  51. this.g.fill();
  52. // 画手臂
  53. var handStart = cc.v2(this.dir * -27, 102);
  54. var handEnd = cc.v2(this.dir * -64, 79);
  55. this.g.lineWidth = this.config.LINE_WIDTH;
  56. this.g.moveTo(handStart.x, handStart.y);
  57. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -45, 115, handEnd.x, handEnd.y);
  58. this.g.stroke();
  59. // 画裤子
  60. var trousersStart = cc.v2(this.dir * -10, 79);
  61. var trousersEnd = cc.v2(this.dir * -33, 83);
  62. this.g.moveTo(trousersStart.x, trousersStart.y);
  63. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  64. this.g.stroke();
  65. // 画腿
  66. var legStart = cc.v2(this.dir * -14, 76);
  67. var legEnd = cc.v2(0, 0)
  68. this.g.moveTo(legStart.x, legStart.y);
  69. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 5, 60, legEnd.x, legEnd.y);
  70. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  71. this.g.stroke();
  72. legStart = cc.v2(this.dir * -26, 76);
  73. legEnd = cc.v2(this.dir * -62, 0)
  74. this.g.moveTo(legStart.x, legStart.y);
  75. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -55, 35, legEnd.x, legEnd.y);
  76. this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
  77. this.g.stroke();
  78. },
  79. peel_002:function() {
  80. // 画脑袋和身体
  81. this.g.lineWidth = this.config.CIRCLE_WIDTH
  82. // 画个脑袋
  83. this.g.fillColor.fromHEX('#ffffff');
  84. this.g.circle(this.dir * -56, 85, this.config.HEAD_SIZE);
  85. this.g.close();
  86. this.g.stroke();
  87. this.g.fill();
  88. // 画个身体
  89. this.g.fillColor.fromHEX('#ffffff');
  90. this.g.circle(this.dir * -52, 57, this.config.BODY_SIZE);
  91. this.g.close();
  92. this.g.stroke();
  93. this.g.fill();
  94. // 画手臂
  95. var handStart = cc.v2(this.dir * -44, 69);
  96. var handEnd = cc.v2(this.dir * 6, 54);
  97. this.g.lineWidth = this.config.LINE_WIDTH;
  98. this.g.moveTo(handStart.x, handStart.y);
  99. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -10, 51, handEnd.x, handEnd.y);
  100. this.g.stroke();
  101. // 画个球拍
  102. this.g.lineWidth = this.config.CIRCLE_WIDTH
  103. this.g.fillColor.fromHEX('#ffffff');
  104. this.g.circle(handEnd.x + this.dir * 2, handEnd.y + 3, this.config.BAT_SIZE);
  105. this.g.close();
  106. this.g.stroke();
  107. this.g.fill();
  108. // 画手臂
  109. var handStart = cc.v2(this.dir * -63, 66);
  110. var handEnd = cc.v2(this.dir * -74, 25);
  111. this.g.lineWidth = this.config.LINE_WIDTH;
  112. this.g.moveTo(handStart.x, handStart.y);
  113. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * -105, 52, handEnd.x, handEnd.y);
  114. this.g.stroke();
  115. // 画裤子
  116. var trousersStart = cc.v2(this.dir * -41, 47);
  117. var trousersEnd = cc.v2(this.dir * -66, 51);
  118. this.g.moveTo(trousersStart.x, trousersStart.y);
  119. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  120. this.g.stroke();
  121. // 画腿
  122. var legStart = cc.v2(this.dir * -43, 45);
  123. var legEnd = cc.v2(0, 2)
  124. this.g.moveTo(legStart.x, legStart.y);
  125. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 80, legEnd.x, legEnd.y);
  126. this.g.lineTo(legEnd.x + this.dir * 6, 0);
  127. this.g.stroke();
  128. legStart = cc.v2(this.dir * -62, 44);
  129. legEnd = cc.v2(this.dir * -61, 2)
  130. this.g.moveTo(legStart.x, legStart.y);
  131. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * -140, 65, legEnd.x, legEnd.y);
  132. this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
  133. this.g.stroke();
  134. },
  135. peel_003:function() {
  136. // 画脑袋
  137. this.g.lineWidth = this.config.LINE_WIDTH;
  138. this.g.fillColor.fromHEX('#ffffff');
  139. if (this.loc == 0) {
  140. this.g.arc(29, 55, this.config.HEAD_SIZE, Math.PI / 2 - Math.PI / 8, Math.PI * 1.5, true)
  141. this.g.lineTo(54, 46);
  142. this.g.arc(53, 50, this.config.HEAD_SIZE, Math.PI * 1.5 + Math.PI / 12, Math.PI / 2, true)
  143. this.g.lineTo(31, 59);
  144. } else {
  145. this.g.arc(-29, 55, this.config.HEAD_SIZE, Math.PI / 2 + Math.PI / 8, Math.PI * 1.5, false)
  146. this.g.lineTo(-54, 46);
  147. this.g.arc(-53, 50, this.config.HEAD_SIZE, Math.PI * 1.5 - Math.PI / 12, Math.PI / 2, false)
  148. this.g.lineTo(-31, 59);
  149. }
  150. // 画个身体
  151. this.g.lineWidth = this.config.CIRCLE_WIDTH
  152. this.g.fillColor.fromHEX('#ffffff');
  153. this.g.circle(this.dir * 45, 23, this.config.BODY_SIZE);
  154. this.g.close();
  155. this.g.stroke();
  156. this.g.fill();
  157. // 画手臂
  158. var handStart = cc.v2(this.dir * 59, 25);
  159. var handEnd = cc.v2(this.dir * 79, 66);
  160. this.g.lineWidth = this.config.LINE_WIDTH;
  161. this.g.moveTo(handStart.x, handStart.y);
  162. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 90, 35, handEnd.x, handEnd.y);
  163. this.g.stroke();
  164. // 画个球拍
  165. this.g.lineWidth = this.config.CIRCLE_WIDTH
  166. this.g.fillColor.fromHEX('#ffffff');
  167. this.g.circle(handEnd.x - this.dir * 4, handEnd.y + 1, this.config.BAT_SIZE);
  168. this.g.close();
  169. this.g.stroke();
  170. this.g.fill();
  171. // 画手臂
  172. var handStart = cc.v2(this.dir * 34, 31);
  173. var handEnd = cc.v2(this.dir * -28, 38);
  174. this.g.lineWidth = this.config.LINE_WIDTH;
  175. this.g.moveTo(handStart.x, handStart.y);
  176. this.g.bezierCurveTo(handStart.x, handStart.y, 0, 22, handEnd.x, handEnd.y);
  177. this.g.stroke();
  178. // 画裤子
  179. var trousersStart = cc.v2(this.dir * 30, 23);
  180. var trousersEnd = cc.v2(this.dir * 51, 9);
  181. this.g.moveTo(trousersStart.x, trousersStart.y);
  182. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  183. this.g.stroke();
  184. // 画腿
  185. var legStart = cc.v2(this.dir * 55, 11);
  186. var legEnd = cc.v2(this.dir * 100, -32)
  187. this.g.moveTo(legStart.x, legStart.y);
  188. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
  189. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  190. this.g.stroke();
  191. legStart = cc.v2(this.dir * 32, 14);
  192. legEnd = cc.v2(this.dir * -63, -1)
  193. this.g.moveTo(legStart.x, legStart.y);
  194. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
  195. this.g.lineTo(legEnd.x - this.dir * 6, legEnd.y);
  196. this.g.stroke();
  197. },
  198. peel_004:function() {
  199. // 画脑袋和身体
  200. this.g.lineWidth = this.config.CIRCLE_WIDTH
  201. // 画个脑袋
  202. this.g.fillColor.fromHEX('#ffffff');
  203. this.g.circle(this.dir * 60, 47, this.config.HEAD_SIZE);
  204. this.g.close();
  205. this.g.stroke();
  206. this.g.fill();
  207. // 画个身体
  208. this.g.lineWidth = this.config.CIRCLE_WIDTH
  209. this.g.fillColor.fromHEX('#ffffff');
  210. this.g.circle(this.dir * 50, 20, this.config.BODY_SIZE);
  211. this.g.close();
  212. this.g.stroke();
  213. this.g.fill();
  214. // 画手臂
  215. var handStart = cc.v2(this.dir * 63, 23);
  216. var handEnd = cc.v2(this.dir * 100, 73);
  217. this.g.lineWidth = this.config.LINE_WIDTH;
  218. this.g.moveTo(handStart.x, handStart.y);
  219. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 85, 30, handEnd.x, handEnd.y);
  220. this.g.stroke();
  221. // 画个球拍
  222. this.g.lineWidth = this.config.CIRCLE_WIDTH
  223. this.g.fillColor.fromHEX('#ffffff');
  224. this.g.circle(handEnd.x - this.dir * 5, handEnd.y - 1, this.config.BAT_SIZE);
  225. this.g.close();
  226. this.g.stroke();
  227. this.g.fill();
  228. // 画手臂
  229. var handStart = cc.v2(this.dir * 44, 31);
  230. var handEnd = cc.v2(this.dir * -15, 58);
  231. this.g.lineWidth = this.config.LINE_WIDTH;
  232. this.g.moveTo(handStart.x, handStart.y);
  233. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 10, 35, handEnd.x, handEnd.y);
  234. this.g.stroke();
  235. // 画裤子
  236. var trousersStart = cc.v2(this.dir * 35, 25);
  237. var trousersEnd = cc.v2(this.dir * 52, 5);
  238. this.g.moveTo(trousersStart.x, trousersStart.y);
  239. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  240. this.g.stroke();
  241. var legStart = cc.v2(this.dir * 61, 10);
  242. var legEnd = cc.v2(this.dir * 100, -33)
  243. this.g.moveTo(legStart.x, legStart.y);
  244. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
  245. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  246. this.g.stroke();
  247. // 画腿
  248. legStart = cc.v2(this.dir * 37, 11);
  249. legEnd = cc.v2(this.dir * -66, -1)
  250. this.g.moveTo(legStart.x, legStart.y);
  251. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
  252. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  253. this.g.stroke();
  254. },
  255. peel_005:function() {
  256. // 画脑袋和身体
  257. this.g.lineWidth = this.config.CIRCLE_WIDTH
  258. // 画个脑袋
  259. this.g.fillColor.fromHEX('#ffffff');
  260. this.g.circle(this.dir * 61, 52, this.config.HEAD_SIZE);
  261. this.g.close();
  262. this.g.stroke();
  263. this.g.fill();
  264. // 画个身体
  265. this.g.lineWidth = this.config.CIRCLE_WIDTH
  266. this.g.fillColor.fromHEX('#ffffff');
  267. this.g.circle(this.dir * 49, 25, this.config.BODY_SIZE);
  268. this.g.close();
  269. this.g.stroke();
  270. this.g.fill();
  271. // 画手臂
  272. var handStart = cc.v2(this.dir * 63, 28);
  273. var handEnd = cc.v2(this.dir * 110, -9);
  274. this.g.lineWidth = this.config.LINE_WIDTH;
  275. this.g.moveTo(handStart.x, handStart.y);
  276. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 85, 19, handEnd.x, handEnd.y);
  277. this.g.stroke();
  278. // 画个球拍
  279. this.g.lineWidth = this.config.LINE_WIDTH;
  280. this.g.fillColor.fromHEX('#ffffff');
  281. if (this.loc == 0) {
  282. // 正位
  283. this.g.arc(110, 60, this.config.BAT_SIZE + 2, Math.PI * 1.5 - Math.PI / 8, Math.PI / 4, false);
  284. this.g.bezierCurveTo(113, 62, 142, 30, 118, -9);
  285. this.g.arc(113, -6, this.config.BAT_SIZE + 2, -Math.PI / 8, Math.PI - Math.PI / 4, false);
  286. this.g.bezierCurveTo(111, -8, 130, 30, 107, 57);
  287. } else {
  288. // 逆位
  289. this.g.arc(-110, 60, this.config.BAT_SIZE + 2, Math.PI * 1.5 + Math.PI / 8, Math.PI / 4 * 3, true);
  290. this.g.bezierCurveTo(-113, 62, -142, 30, -118, -9);
  291. this.g.arc(-113, -6, this.config.BAT_SIZE + 2, Math.PI + Math.PI / 8, Math.PI / 4, true);
  292. this.g.bezierCurveTo(-111, -8, -130, 30, -107, 57);
  293. }
  294. this.g.stroke();
  295. // 画手臂
  296. var handStart = cc.v2(this.dir * 41, 33);
  297. var handEnd = cc.v2(this.dir * -12, 58);
  298. this.g.lineWidth = this.config.LINE_WIDTH;
  299. this.g.moveTo(handStart.x, handStart.y);
  300. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 10, 43, handEnd.x, handEnd.y);
  301. this.g.stroke();
  302. // 画裤子
  303. var trousersStart = cc.v2(this.dir * 36, 27);
  304. var trousersEnd = cc.v2(this.dir * 51, 10);
  305. this.g.moveTo(trousersStart.x, trousersStart.y);
  306. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  307. this.g.stroke();
  308. var legStart = cc.v2(this.dir * 54, 10);
  309. var legEnd = cc.v2(this.dir * 100, -33)
  310. this.g.moveTo(legStart.x, legStart.y);
  311. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 120, 40, legEnd.x, legEnd.y);
  312. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  313. this.g.stroke();
  314. // 画腿
  315. legStart = cc.v2(this.dir * 39, 14);
  316. legEnd = cc.v2(this.dir * -66, -1)
  317. this.g.moveTo(legStart.x, legStart.y);
  318. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
  319. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  320. this.g.stroke();
  321. },
  322. peel_006:function() {
  323. // 画脑袋和身体
  324. this.g.lineWidth = this.config.CIRCLE_WIDTH
  325. // 画个脑袋
  326. this.g.fillColor.fromHEX('#ffffff');
  327. this.g.circle(this.dir * 68, 56, this.config.HEAD_SIZE);
  328. this.g.close();
  329. this.g.stroke();
  330. this.g.fill();
  331. // 画个身体
  332. this.g.lineWidth = this.config.CIRCLE_WIDTH
  333. this.g.fillColor.fromHEX('#ffffff');
  334. this.g.circle(this.dir * 58, 30, this.config.BODY_SIZE);
  335. this.g.close();
  336. this.g.stroke();
  337. this.g.fill();
  338. // 画手臂
  339. var handStart = cc.v2(this.dir * 71, 30);
  340. var handEnd = cc.v2(this.dir * 45, -18);
  341. this.g.lineWidth = this.config.LINE_WIDTH;
  342. this.g.moveTo(handStart.x, handStart.y);
  343. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 82, 5, handEnd.x, handEnd.y);
  344. this.g.stroke();
  345. // 画个球拍
  346. this.g.lineWidth = this.config.CIRCLE_WIDTH
  347. this.g.fillColor.fromHEX('#ffffff');
  348. this.g.circle(handEnd.x - this.dir * 1, handEnd.y + 8, this.config.BAT_SIZE);
  349. this.g.close();
  350. this.g.stroke();
  351. this.g.fill();
  352. // 画手臂
  353. var handStart = cc.v2(this.dir * 47, 40);
  354. var handEnd = cc.v2(this.dir * -18, 54);
  355. this.g.lineWidth = this.config.LINE_WIDTH;
  356. this.g.moveTo(handStart.x, handStart.y);
  357. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 26, 43, handEnd.x, handEnd.y);
  358. this.g.stroke();
  359. // 画裤子
  360. var trousersStart = cc.v2(this.dir * 43, 31);
  361. var trousersEnd = cc.v2(this.dir * 63, 14);
  362. this.g.moveTo(trousersStart.x, trousersStart.y);
  363. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  364. this.g.stroke();
  365. var legStart = cc.v2(this.dir * 61, 14);
  366. var legEnd = cc.v2(this.dir * 100, -33)
  367. this.g.moveTo(legStart.x, legStart.y);
  368. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 140, 20, legEnd.x, legEnd.y);
  369. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  370. this.g.stroke();
  371. // 画腿
  372. legStart = cc.v2(this.dir * 45, 21);
  373. legEnd = cc.v2(this.dir * -66, -1)
  374. this.g.moveTo(legStart.x, legStart.y);
  375. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
  376. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  377. this.g.stroke();
  378. },
  379. peel_007:function() {
  380. // 画脑袋和身体
  381. this.g.lineWidth = this.config.CIRCLE_WIDTH
  382. // 画个脑袋
  383. this.g.fillColor.fromHEX('#ffffff');
  384. this.g.circle(this.dir * 61, 52, this.config.HEAD_SIZE);
  385. this.g.close();
  386. this.g.stroke();
  387. this.g.fill();
  388. // 画个身体
  389. this.g.lineWidth = this.config.CIRCLE_WIDTH
  390. this.g.fillColor.fromHEX('#ffffff');
  391. this.g.circle(this.dir * 50, 25, this.config.BODY_SIZE);
  392. this.g.close();
  393. this.g.stroke();
  394. this.g.fill();
  395. // 画手臂
  396. var handStart = cc.v2(this.dir * 65, 26);
  397. var handEnd = cc.v2(this.dir * 33, -4);
  398. this.g.lineWidth = this.config.LINE_WIDTH;
  399. this.g.moveTo(handStart.x, handStart.y);
  400. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 82, -10, handEnd.x, handEnd.y);
  401. this.g.stroke();
  402. // 画个球拍
  403. this.g.lineWidth = this.config.CIRCLE_WIDTH
  404. this.g.fillColor.fromHEX('#ffffff');
  405. this.g.circle(handEnd.x - this.dir * 1, handEnd.y + 6, this.config.BAT_SIZE);
  406. this.g.close();
  407. this.g.stroke();
  408. this.g.fill();
  409. // 画手臂
  410. var handStart = cc.v2(this.dir * 50, 39);
  411. var handEnd = cc.v2(this.dir * -21, 42);
  412. this.g.lineWidth = this.config.LINE_WIDTH;
  413. this.g.moveTo(handStart.x, handStart.y);
  414. this.g.bezierCurveTo(handStart.x, handStart.y, this.dir * 30, 45, handEnd.x, handEnd.y);
  415. this.g.stroke();
  416. // 画裤子
  417. var trousersStart = cc.v2(this.dir * 35, 28);
  418. var trousersEnd = cc.v2(this.dir * 53, 10);
  419. this.g.moveTo(trousersStart.x, trousersStart.y);
  420. this.g.lineTo(trousersEnd.x, trousersEnd.y);
  421. this.g.stroke();
  422. var legStart = cc.v2(this.dir * 57, 12);
  423. var legEnd = cc.v2(this.dir * 100, -33)
  424. this.g.moveTo(legStart.x, legStart.y);
  425. this.g.bezierCurveTo(legStart.x, legStart.y, this.dir * 140, 20, legEnd.x, legEnd.y);
  426. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  427. this.g.stroke();
  428. // 画腿
  429. legStart = cc.v2(this.dir * 38, 19);
  430. legEnd = cc.v2(this.dir * -66, -1)
  431. this.g.moveTo(legStart.x, legStart.y);
  432. this.g.bezierCurveTo(legStart.x, legStart.y, 0, 10, legEnd.x, legEnd.y);
  433. this.g.lineTo(legEnd.x + this.dir * 6, legEnd.y);
  434. this.g.stroke();
  435. },
  436. // update (dt) {},
  437. });