├── .gitignore ├── README.md ├── assets ├── Game.fire ├── Game.fire.meta ├── audio.meta ├── audio │ ├── ballin.mp3 │ ├── ballin.mp3.meta │ ├── fly.mp3 │ ├── fly.mp3.meta │ ├── hitboard.mp3 │ ├── hitboard.mp3.meta │ ├── hitboardin.mp3 │ ├── hitboardin.mp3.meta │ ├── score.mp3 │ └── score.mp3.meta ├── font.meta ├── font │ ├── mikado_outline_shadow.fnt │ ├── mikado_outline_shadow.fnt.meta │ ├── mikado_outline_shadow.png │ └── mikado_outline_shadow.png.meta ├── prefab.meta ├── prefab │ ├── ball.prefab │ ├── ball.prefab.meta │ ├── line.prefab │ ├── line.prefab.meta │ ├── shadow.prefab │ └── shadow.prefab.meta ├── res.meta ├── res │ ├── basket_bg.png │ ├── basket_bg.png.meta │ ├── basketball.png │ ├── basketball.png.meta │ ├── game_bg.png │ ├── game_bg.png.meta │ ├── line.png │ ├── line.png.meta │ ├── net.png │ ├── net.png.meta │ ├── score_bg.png │ ├── score_bg.png.meta │ ├── shadow.png │ ├── shadow.png.meta │ ├── shadow2.png │ ├── shadow2.png.meta │ ├── star.png │ ├── star.png.meta │ ├── time.png │ └── time.png.meta ├── script.meta └── script │ ├── Ball.js │ ├── Ball.js.meta │ ├── Basket.js │ ├── Basket.js.meta │ ├── CollisionBox.js │ ├── CollisionBox.js.meta │ ├── GameManager.js │ ├── GameManager.js.meta │ ├── Line.js │ ├── Line.js.meta │ ├── Score.js │ ├── Score.js.meta │ ├── Shadow.js │ ├── Shadow.js.meta │ ├── SoundManager.js │ ├── SoundManager.js.meta │ ├── TimeManager.js │ └── TimeManager.js.meta ├── project.json ├── screenshot ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png ├── screenshot4.png └── screenshot5.png └── settings ├── builder.json └── project.json /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | *.iml 3 | .DS_Store 4 | /library 5 | /local 6 | /temp 7 | /packages 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##1 搭建项目开发环境 2 | 1.1 安装 CocosCreator 3 | 4 | ##2 打开项目 5 | 2.1 选择打开其他项目,然后选择本项目目录 6 | 7 | 2.2 项目初始化后你会看到 8 | 9 | ![Image][1] 10 | 11 | ##3 运行项目 12 | 3.1 可以选择浏览器和模拟器运行项目 13 | 14 | ![Image][5] 15 | 16 | 3.2 点击小三角运行项目 17 | 18 | ![Image][2] 19 | 20 | *浏览器运行* 21 | 22 | ![Image][4] 23 | 24 | *模拟器运行* 25 | 26 | ![Image][3] 27 | 28 | [1]: https://raw.githubusercontent.com/liang3472/BasketBall/master/screenshot/screenshot1.png 29 | [2]: https://raw.githubusercontent.com/liang3472/BasketBall/master/screenshot/screenshot2.png 30 | [3]: https://raw.githubusercontent.com/liang3472/BasketBall/master/screenshot/screenshot3.png 31 | [4]: https://raw.githubusercontent.com/liang3472/BasketBall/master/screenshot/screenshot4.png 32 | [5]: https://raw.githubusercontent.com/liang3472/BasketBall/master/screenshot/screenshot5.png 33 | -------------------------------------------------------------------------------- /assets/Game.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_name": "", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0, 28 | "y": 0 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 0, 33 | "height": 0 34 | }, 35 | "_children": [ 36 | { 37 | "__id__": 2 38 | } 39 | ], 40 | "_localZOrder": 0, 41 | "_globalZOrder": 0, 42 | "_tag": -1, 43 | "_opacityModifyRGB": false, 44 | "_reorderChildDirty": false, 45 | "_id": "bbb8e11b-4e63-45cb-bee5-9f41d96a1271" 46 | }, 47 | { 48 | "__type__": "cc.Node", 49 | "_name": "Canvas", 50 | "_objFlags": 0, 51 | "_opacity": 255, 52 | "_color": { 53 | "__type__": "cc.Color", 54 | "r": 255, 55 | "g": 255, 56 | "b": 255, 57 | "a": 255 58 | }, 59 | "_cascadeOpacityEnabled": true, 60 | "_parent": { 61 | "__id__": 1 62 | }, 63 | "_anchorPoint": { 64 | "__type__": "cc.Vec2", 65 | "x": 0.5, 66 | "y": 0.5 67 | }, 68 | "_contentSize": { 69 | "__type__": "cc.Size", 70 | "width": 750, 71 | "height": 1214 72 | }, 73 | "_children": [ 74 | { 75 | "__id__": 3 76 | }, 77 | { 78 | "__id__": 6 79 | }, 80 | { 81 | "__id__": 13 82 | }, 83 | { 84 | "__id__": 32 85 | } 86 | ], 87 | "_rotationX": 0, 88 | "_rotationY": 0, 89 | "_scaleX": 1, 90 | "_scaleY": 1, 91 | "_position": { 92 | "__type__": "cc.Vec2", 93 | "x": 375, 94 | "y": 607 95 | }, 96 | "_skewX": 0, 97 | "_skewY": 0, 98 | "_localZOrder": 0, 99 | "_globalZOrder": 0, 100 | "_tag": -1, 101 | "_opacityModifyRGB": false, 102 | "_reorderChildDirty": false, 103 | "_id": "b9fa0kkullLiKJwSjZnzcoI", 104 | "_active": true, 105 | "_components": [ 106 | { 107 | "__id__": 36 108 | } 109 | ], 110 | "_prefab": null, 111 | "groupIndex": 0 112 | }, 113 | { 114 | "__type__": "cc.Node", 115 | "_name": "bg", 116 | "_objFlags": 0, 117 | "_opacity": 255, 118 | "_color": { 119 | "__type__": "cc.Color", 120 | "r": 255, 121 | "g": 255, 122 | "b": 255, 123 | "a": 255 124 | }, 125 | "_cascadeOpacityEnabled": true, 126 | "_parent": { 127 | "__id__": 2 128 | }, 129 | "_anchorPoint": { 130 | "__type__": "cc.Vec2", 131 | "x": 0.5, 132 | "y": 0.5 133 | }, 134 | "_contentSize": { 135 | "__type__": "cc.Size", 136 | "width": 750, 137 | "height": 1214 138 | }, 139 | "_children": [], 140 | "_rotationX": 0, 141 | "_rotationY": 0, 142 | "_scaleX": 1, 143 | "_scaleY": 1, 144 | "_position": { 145 | "__type__": "cc.Vec2", 146 | "x": 0, 147 | "y": 0 148 | }, 149 | "_skewX": 0, 150 | "_skewY": 0, 151 | "_localZOrder": 0, 152 | "_globalZOrder": 0, 153 | "_tag": -1, 154 | "_opacityModifyRGB": false, 155 | "_reorderChildDirty": false, 156 | "_id": "bd2a5Cuz2lBGrLh8ZQrKyZT", 157 | "_active": true, 158 | "_components": [ 159 | { 160 | "__id__": 4 161 | }, 162 | { 163 | "__id__": 5 164 | } 165 | ], 166 | "_prefab": null, 167 | "groupIndex": 0 168 | }, 169 | { 170 | "__type__": "cc.Sprite", 171 | "_name": "", 172 | "_objFlags": 0, 173 | "node": { 174 | "__id__": 3 175 | }, 176 | "_enabled": true, 177 | "_spriteFrame": { 178 | "__uuid__": "ff8d133e-c0f6-4cc7-a5fb-f2b33dbc1ed7" 179 | }, 180 | "_type": 0, 181 | "_sizeMode": 0, 182 | "_fillType": 0, 183 | "_fillCenter": { 184 | "__type__": "cc.Vec2", 185 | "x": 0, 186 | "y": 0 187 | }, 188 | "_fillStart": 0, 189 | "_fillRange": 0, 190 | "_isTrimmedMode": true, 191 | "_srcBlendFactor": 770, 192 | "_dstBlendFactor": 771, 193 | "_atlas": null 194 | }, 195 | { 196 | "__type__": "cc.Widget", 197 | "_name": "", 198 | "_objFlags": 0, 199 | "node": { 200 | "__id__": 3 201 | }, 202 | "_enabled": true, 203 | "isAlignOnce": false, 204 | "_alignFlags": 45, 205 | "_left": 0, 206 | "_right": 0, 207 | "_top": 0, 208 | "_bottom": 0, 209 | "_isAbsLeft": true, 210 | "_isAbsRight": true, 211 | "_isAbsTop": true, 212 | "_isAbsBottom": true, 213 | "_originalWidth": 100, 214 | "_originalHeight": 100 215 | }, 216 | { 217 | "__type__": "cc.Node", 218 | "_name": "score", 219 | "_objFlags": 0, 220 | "_opacity": 255, 221 | "_color": { 222 | "__type__": "cc.Color", 223 | "r": 255, 224 | "g": 255, 225 | "b": 255, 226 | "a": 255 227 | }, 228 | "_cascadeOpacityEnabled": true, 229 | "_parent": { 230 | "__id__": 2 231 | }, 232 | "_anchorPoint": { 233 | "__type__": "cc.Vec2", 234 | "x": 0.5, 235 | "y": 0.5 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 253, 240 | "height": 123 241 | }, 242 | "_children": [ 243 | { 244 | "__id__": 7 245 | }, 246 | { 247 | "__id__": 9 248 | } 249 | ], 250 | "_rotationX": 0, 251 | "_rotationY": 0, 252 | "_scaleX": 1, 253 | "_scaleY": 1, 254 | "_position": { 255 | "__type__": "cc.Vec2", 256 | "x": 237.25, 257 | "y": 533.36 258 | }, 259 | "_skewX": 0, 260 | "_skewY": 0, 261 | "_localZOrder": 0, 262 | "_globalZOrder": 0, 263 | "_tag": -1, 264 | "_opacityModifyRGB": false, 265 | "_reorderChildDirty": false, 266 | "_id": "0037bBQ6LNOsKgEvg3SFAvh", 267 | "_active": true, 268 | "_components": [ 269 | { 270 | "__id__": 11 271 | }, 272 | { 273 | "__id__": 12 274 | } 275 | ], 276 | "_prefab": null, 277 | "groupIndex": 0 278 | }, 279 | { 280 | "__type__": "cc.Node", 281 | "_name": "bg", 282 | "_objFlags": 0, 283 | "_opacity": 255, 284 | "_color": { 285 | "__type__": "cc.Color", 286 | "r": 255, 287 | "g": 255, 288 | "b": 255, 289 | "a": 255 290 | }, 291 | "_cascadeOpacityEnabled": true, 292 | "_parent": { 293 | "__id__": 6 294 | }, 295 | "_anchorPoint": { 296 | "__type__": "cc.Vec2", 297 | "x": 0.5, 298 | "y": 0.5 299 | }, 300 | "_contentSize": { 301 | "__type__": "cc.Size", 302 | "width": 253, 303 | "height": 123 304 | }, 305 | "_children": [], 306 | "_rotationX": 0, 307 | "_rotationY": 0, 308 | "_scaleX": 1, 309 | "_scaleY": 1, 310 | "_position": { 311 | "__type__": "cc.Vec2", 312 | "x": 0, 313 | "y": 0 314 | }, 315 | "_skewX": 0, 316 | "_skewY": 0, 317 | "_localZOrder": 0, 318 | "_globalZOrder": 0, 319 | "_tag": -1, 320 | "_opacityModifyRGB": false, 321 | "_reorderChildDirty": false, 322 | "_id": "abe3eymPTpDBqqiaE3lXc8S", 323 | "_active": true, 324 | "_components": [ 325 | { 326 | "__id__": 8 327 | } 328 | ], 329 | "_prefab": null, 330 | "groupIndex": 0 331 | }, 332 | { 333 | "__type__": "cc.Sprite", 334 | "_name": "", 335 | "_objFlags": 0, 336 | "node": { 337 | "__id__": 7 338 | }, 339 | "_enabled": true, 340 | "_spriteFrame": { 341 | "__uuid__": "12e97f52-2cc8-447a-b1d9-5c7cc47dc9b7" 342 | }, 343 | "_type": 0, 344 | "_sizeMode": 0, 345 | "_fillType": 0, 346 | "_fillCenter": { 347 | "__type__": "cc.Vec2", 348 | "x": 0, 349 | "y": 0 350 | }, 351 | "_fillStart": 0, 352 | "_fillRange": 0, 353 | "_isTrimmedMode": true, 354 | "_srcBlendFactor": 770, 355 | "_dstBlendFactor": 771, 356 | "_atlas": null 357 | }, 358 | { 359 | "__type__": "cc.Node", 360 | "_name": "scoreText", 361 | "_objFlags": 0, 362 | "_opacity": 255, 363 | "_color": { 364 | "__type__": "cc.Color", 365 | "r": 255, 366 | "g": 255, 367 | "b": 255, 368 | "a": 255 369 | }, 370 | "_cascadeOpacityEnabled": true, 371 | "_parent": { 372 | "__id__": 6 373 | }, 374 | "_anchorPoint": { 375 | "__type__": "cc.Vec2", 376 | "x": 0.5, 377 | "y": 0.5 378 | }, 379 | "_contentSize": { 380 | "__type__": "cc.Size", 381 | "width": 110, 382 | "height": 44.44 383 | }, 384 | "_children": [], 385 | "_rotationX": 0, 386 | "_rotationY": 0, 387 | "_scaleX": 1, 388 | "_scaleY": 1, 389 | "_position": { 390 | "__type__": "cc.Vec2", 391 | "x": 53, 392 | "y": 13 393 | }, 394 | "_skewX": 0, 395 | "_skewY": 0, 396 | "_localZOrder": 0, 397 | "_globalZOrder": 0, 398 | "_tag": -1, 399 | "_opacityModifyRGB": false, 400 | "_reorderChildDirty": false, 401 | "_id": "f0142XUInJEi7K2Wf5AiNhm", 402 | "_active": true, 403 | "_components": [ 404 | { 405 | "__id__": 10 406 | } 407 | ], 408 | "_prefab": null, 409 | "groupIndex": 0 410 | }, 411 | { 412 | "__type__": "cc.Label", 413 | "_name": "", 414 | "_objFlags": 0, 415 | "node": { 416 | "__id__": 9 417 | }, 418 | "_enabled": true, 419 | "_useOriginalSize": false, 420 | "_fontSize": 39, 421 | "_lineHeight": 40, 422 | "_enableWrapText": false, 423 | "_N$file": { 424 | "__uuid__": "efeaba4f-2504-4697-8d07-9e3af2446556" 425 | }, 426 | "_isSystemFontUsed": false, 427 | "_N$string": "score", 428 | "_N$horizontalAlign": 2, 429 | "_N$verticalAlign": 1, 430 | "_N$overflow": 2 431 | }, 432 | { 433 | "__type__": "cc.Widget", 434 | "_name": "", 435 | "_objFlags": 0, 436 | "node": { 437 | "__id__": 6 438 | }, 439 | "_enabled": true, 440 | "isAlignOnce": false, 441 | "_alignFlags": 33, 442 | "_left": 0, 443 | "_right": 0.015, 444 | "_top": 0.01, 445 | "_bottom": 0, 446 | "_isAbsLeft": true, 447 | "_isAbsRight": false, 448 | "_isAbsTop": false, 449 | "_isAbsBottom": true, 450 | "_originalWidth": 0, 451 | "_originalHeight": 0 452 | }, 453 | { 454 | "__type__": "0dbad8nuMBK8L4YWla50RjT", 455 | "_name": "", 456 | "_objFlags": 0, 457 | "node": { 458 | "__id__": 6 459 | }, 460 | "_enabled": true, 461 | "scoreText": { 462 | "__id__": 10 463 | } 464 | }, 465 | { 466 | "__type__": "cc.Node", 467 | "_name": "basket", 468 | "_objFlags": 0, 469 | "_opacity": 255, 470 | "_color": { 471 | "__type__": "cc.Color", 472 | "r": 255, 473 | "g": 255, 474 | "b": 255, 475 | "a": 255 476 | }, 477 | "_cascadeOpacityEnabled": true, 478 | "_parent": { 479 | "__id__": 2 480 | }, 481 | "_anchorPoint": { 482 | "__type__": "cc.Vec2", 483 | "x": 0.5, 484 | "y": 0.5 485 | }, 486 | "_contentSize": { 487 | "__type__": "cc.Size", 488 | "width": 300, 489 | "height": 300 490 | }, 491 | "_children": [ 492 | { 493 | "__id__": 14 494 | }, 495 | { 496 | "__id__": 17 497 | }, 498 | { 499 | "__id__": 21 500 | }, 501 | { 502 | "__id__": 25 503 | }, 504 | { 505 | "__id__": 29 506 | } 507 | ], 508 | "_rotationX": 0, 509 | "_rotationY": 0, 510 | "_scaleX": 1, 511 | "_scaleY": 1, 512 | "_position": { 513 | "__type__": "cc.Vec2", 514 | "x": 0, 515 | "y": 205 516 | }, 517 | "_skewX": 0, 518 | "_skewY": 0, 519 | "_localZOrder": 0, 520 | "_globalZOrder": 0, 521 | "_tag": -1, 522 | "_opacityModifyRGB": false, 523 | "_reorderChildDirty": false, 524 | "_id": "9725bzBzk9Fmam4ZhlWOU1c", 525 | "_active": true, 526 | "_components": [ 527 | { 528 | "__id__": 31 529 | } 530 | ], 531 | "_prefab": null, 532 | "groupIndex": 0 533 | }, 534 | { 535 | "__type__": "cc.Node", 536 | "_name": "bg", 537 | "_objFlags": 0, 538 | "_opacity": 255, 539 | "_color": { 540 | "__type__": "cc.Color", 541 | "r": 255, 542 | "g": 255, 543 | "b": 255, 544 | "a": 255 545 | }, 546 | "_cascadeOpacityEnabled": true, 547 | "_parent": { 548 | "__id__": 13 549 | }, 550 | "_anchorPoint": { 551 | "__type__": "cc.Vec2", 552 | "x": 0.5, 553 | "y": 1 554 | }, 555 | "_contentSize": { 556 | "__type__": "cc.Size", 557 | "width": 536, 558 | "height": 381 559 | }, 560 | "_children": [], 561 | "_rotationX": 0, 562 | "_rotationY": 0, 563 | "_scaleX": 1, 564 | "_scaleY": 1, 565 | "_position": { 566 | "__type__": "cc.Vec2", 567 | "x": 0, 568 | "y": 322 569 | }, 570 | "_skewX": 0, 571 | "_skewY": 0, 572 | "_localZOrder": 0, 573 | "_globalZOrder": 0, 574 | "_tag": -1, 575 | "_opacityModifyRGB": false, 576 | "_reorderChildDirty": false, 577 | "_id": "241bdzCSdhKwZW0zGPlP19m", 578 | "_active": true, 579 | "_components": [ 580 | { 581 | "__id__": 15 582 | }, 583 | { 584 | "__id__": 16 585 | } 586 | ], 587 | "_prefab": null, 588 | "groupIndex": 0 589 | }, 590 | { 591 | "__type__": "cc.Sprite", 592 | "_name": "", 593 | "_objFlags": 0, 594 | "node": { 595 | "__id__": 14 596 | }, 597 | "_enabled": true, 598 | "_spriteFrame": { 599 | "__uuid__": "ced09d8f-e82c-4fb7-abda-db9131264e52" 600 | }, 601 | "_type": 0, 602 | "_sizeMode": 0, 603 | "_fillType": 0, 604 | "_fillCenter": { 605 | "__type__": "cc.Vec2", 606 | "x": 0, 607 | "y": 0 608 | }, 609 | "_fillStart": 0, 610 | "_fillRange": 0, 611 | "_isTrimmedMode": true, 612 | "_srcBlendFactor": 770, 613 | "_dstBlendFactor": 771, 614 | "_atlas": null 615 | }, 616 | { 617 | "__type__": "cc.Widget", 618 | "_name": "", 619 | "_objFlags": 0, 620 | "node": { 621 | "__id__": 14 622 | }, 623 | "_enabled": true, 624 | "isAlignOnce": false, 625 | "_alignFlags": 1, 626 | "_left": 0, 627 | "_right": 0, 628 | "_top": -172, 629 | "_bottom": 0, 630 | "_isAbsLeft": true, 631 | "_isAbsRight": true, 632 | "_isAbsTop": true, 633 | "_isAbsBottom": true, 634 | "_originalWidth": 0, 635 | "_originalHeight": 0 636 | }, 637 | { 638 | "__type__": "cc.Node", 639 | "_name": "time", 640 | "_objFlags": 0, 641 | "_opacity": 255, 642 | "_color": { 643 | "__type__": "cc.Color", 644 | "r": 255, 645 | "g": 255, 646 | "b": 255, 647 | "a": 255 648 | }, 649 | "_cascadeOpacityEnabled": true, 650 | "_parent": { 651 | "__id__": 13 652 | }, 653 | "_anchorPoint": { 654 | "__type__": "cc.Vec2", 655 | "x": 0.5, 656 | "y": 0.5 657 | }, 658 | "_contentSize": { 659 | "__type__": "cc.Size", 660 | "width": 207, 661 | "height": 88 662 | }, 663 | "_children": [ 664 | { 665 | "__id__": 18 666 | } 667 | ], 668 | "_rotationX": 0, 669 | "_rotationY": 0, 670 | "_scaleX": 1, 671 | "_scaleY": 1, 672 | "_position": { 673 | "__type__": "cc.Vec2", 674 | "x": 0, 675 | "y": 210 676 | }, 677 | "_skewX": 0, 678 | "_skewY": 0, 679 | "_localZOrder": 0, 680 | "_globalZOrder": 0, 681 | "_tag": -1, 682 | "_opacityModifyRGB": false, 683 | "_reorderChildDirty": false, 684 | "_id": "8fff4pQIWNNeIAqU+2fkbux", 685 | "_active": true, 686 | "_components": [ 687 | { 688 | "__id__": 20 689 | } 690 | ], 691 | "_prefab": null, 692 | "groupIndex": 0 693 | }, 694 | { 695 | "__type__": "cc.Node", 696 | "_name": "count", 697 | "_objFlags": 0, 698 | "_opacity": 255, 699 | "_color": { 700 | "__type__": "cc.Color", 701 | "r": 255, 702 | "g": 255, 703 | "b": 255, 704 | "a": 255 705 | }, 706 | "_cascadeOpacityEnabled": true, 707 | "_parent": { 708 | "__id__": 17 709 | }, 710 | "_anchorPoint": { 711 | "__type__": "cc.Vec2", 712 | "x": 0.5, 713 | "y": 0.5 714 | }, 715 | "_contentSize": { 716 | "__type__": "cc.Size", 717 | "width": 146.81, 718 | "height": 60 719 | }, 720 | "_children": [], 721 | "_rotationX": 0, 722 | "_rotationY": 0, 723 | "_scaleX": 1, 724 | "_scaleY": 1, 725 | "_position": { 726 | "__type__": "cc.Vec2", 727 | "x": 0, 728 | "y": 0 729 | }, 730 | "_skewX": 0, 731 | "_skewY": 0, 732 | "_localZOrder": 0, 733 | "_globalZOrder": 0, 734 | "_tag": -1, 735 | "_opacityModifyRGB": false, 736 | "_reorderChildDirty": false, 737 | "_id": "5c22dK2GUhAvJ0ui/urpQGg", 738 | "_active": true, 739 | "_components": [ 740 | { 741 | "__id__": 19 742 | } 743 | ], 744 | "_prefab": null, 745 | "groupIndex": 0 746 | }, 747 | { 748 | "__type__": "cc.Label", 749 | "_name": "", 750 | "_objFlags": 0, 751 | "node": { 752 | "__id__": 18 753 | }, 754 | "_enabled": true, 755 | "_useOriginalSize": false, 756 | "_fontSize": 60, 757 | "_lineHeight": 60, 758 | "_enableWrapText": true, 759 | "_N$file": null, 760 | "_isSystemFontUsed": true, 761 | "_N$string": "Label", 762 | "_N$horizontalAlign": 1, 763 | "_N$verticalAlign": 1, 764 | "_N$overflow": 0 765 | }, 766 | { 767 | "__type__": "cc.Sprite", 768 | "_name": "", 769 | "_objFlags": 0, 770 | "node": { 771 | "__id__": 17 772 | }, 773 | "_enabled": true, 774 | "_spriteFrame": { 775 | "__uuid__": "9f334b4e-4393-42a5-ad0a-ba45dcb5596c" 776 | }, 777 | "_type": 0, 778 | "_sizeMode": 1, 779 | "_fillType": 0, 780 | "_fillCenter": { 781 | "__type__": "cc.Vec2", 782 | "x": 0, 783 | "y": 0 784 | }, 785 | "_fillStart": 0, 786 | "_fillRange": 0, 787 | "_isTrimmedMode": true, 788 | "_srcBlendFactor": 770, 789 | "_dstBlendFactor": 771, 790 | "_atlas": null 791 | }, 792 | { 793 | "__type__": "cc.Node", 794 | "_name": "left", 795 | "_objFlags": 0, 796 | "_opacity": 0, 797 | "_color": { 798 | "__type__": "cc.Color", 799 | "r": 0, 800 | "g": 0, 801 | "b": 0, 802 | "a": 255 803 | }, 804 | "_cascadeOpacityEnabled": true, 805 | "_parent": { 806 | "__id__": 13 807 | }, 808 | "_anchorPoint": { 809 | "__type__": "cc.Vec2", 810 | "x": 0.5, 811 | "y": 0.5 812 | }, 813 | "_contentSize": { 814 | "__type__": "cc.Size", 815 | "width": 10, 816 | "height": 10 817 | }, 818 | "_children": [], 819 | "_rotationX": 0, 820 | "_rotationY": 0, 821 | "_scaleX": 1, 822 | "_scaleY": 1, 823 | "_position": { 824 | "__type__": "cc.Vec2", 825 | "x": -86.2, 826 | "y": 43 827 | }, 828 | "_skewX": 0, 829 | "_skewY": 0, 830 | "_localZOrder": 0, 831 | "_globalZOrder": 0, 832 | "_tag": -1, 833 | "_opacityModifyRGB": false, 834 | "_reorderChildDirty": false, 835 | "_id": "73ac6NQhJ5ICYUN0mcoTM1f", 836 | "_active": true, 837 | "_components": [ 838 | { 839 | "__id__": 22 840 | }, 841 | { 842 | "__id__": 23 843 | }, 844 | { 845 | "__id__": 24 846 | } 847 | ], 848 | "_prefab": null, 849 | "groupIndex": 2 850 | }, 851 | { 852 | "__type__": "cc.Sprite", 853 | "_name": "", 854 | "_objFlags": 0, 855 | "node": { 856 | "__id__": 21 857 | }, 858 | "_enabled": true, 859 | "_spriteFrame": { 860 | "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" 861 | }, 862 | "_type": 0, 863 | "_sizeMode": 0, 864 | "_fillType": 0, 865 | "_fillCenter": { 866 | "__type__": "cc.Vec2", 867 | "x": 0, 868 | "y": 0 869 | }, 870 | "_fillStart": 0, 871 | "_fillRange": 0, 872 | "_isTrimmedMode": true, 873 | "_srcBlendFactor": 770, 874 | "_dstBlendFactor": 771, 875 | "_atlas": null 876 | }, 877 | { 878 | "__type__": "cc.BoxCollider", 879 | "_name": "", 880 | "_objFlags": 0, 881 | "node": { 882 | "__id__": 21 883 | }, 884 | "_enabled": true, 885 | "tag": 0, 886 | "_offset": { 887 | "__type__": "cc.Vec2", 888 | "x": 0, 889 | "y": 0 890 | }, 891 | "_size": { 892 | "__type__": "cc.Size", 893 | "width": 10, 894 | "height": 10 895 | } 896 | }, 897 | { 898 | "__type__": "7c4c6Rwi4tIC4UMBgYL4231", 899 | "_name": "", 900 | "_objFlags": 0, 901 | "node": { 902 | "__id__": 21 903 | }, 904 | "_enabled": true 905 | }, 906 | { 907 | "__type__": "cc.Node", 908 | "_name": "right", 909 | "_objFlags": 0, 910 | "_opacity": 0, 911 | "_color": { 912 | "__type__": "cc.Color", 913 | "r": 0, 914 | "g": 0, 915 | "b": 0, 916 | "a": 255 917 | }, 918 | "_cascadeOpacityEnabled": true, 919 | "_parent": { 920 | "__id__": 13 921 | }, 922 | "_anchorPoint": { 923 | "__type__": "cc.Vec2", 924 | "x": 0.5, 925 | "y": 0.5 926 | }, 927 | "_contentSize": { 928 | "__type__": "cc.Size", 929 | "width": 10, 930 | "height": 10 931 | }, 932 | "_children": [], 933 | "_rotationX": 0, 934 | "_rotationY": 0, 935 | "_scaleX": 1, 936 | "_scaleY": 1, 937 | "_position": { 938 | "__type__": "cc.Vec2", 939 | "x": 87.9, 940 | "y": 43 941 | }, 942 | "_skewX": 0, 943 | "_skewY": 0, 944 | "_localZOrder": 0, 945 | "_globalZOrder": 0, 946 | "_tag": -1, 947 | "_opacityModifyRGB": false, 948 | "_reorderChildDirty": false, 949 | "_id": "90b05l7oDFL0LvkDnKSsI/N", 950 | "_active": true, 951 | "_components": [ 952 | { 953 | "__id__": 26 954 | }, 955 | { 956 | "__id__": 27 957 | }, 958 | { 959 | "__id__": 28 960 | } 961 | ], 962 | "_prefab": null, 963 | "groupIndex": 2 964 | }, 965 | { 966 | "__type__": "cc.Sprite", 967 | "_name": "", 968 | "_objFlags": 0, 969 | "node": { 970 | "__id__": 25 971 | }, 972 | "_enabled": true, 973 | "_spriteFrame": { 974 | "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" 975 | }, 976 | "_type": 0, 977 | "_sizeMode": 0, 978 | "_fillType": 0, 979 | "_fillCenter": { 980 | "__type__": "cc.Vec2", 981 | "x": 0, 982 | "y": 0 983 | }, 984 | "_fillStart": 0, 985 | "_fillRange": 0, 986 | "_isTrimmedMode": true, 987 | "_srcBlendFactor": 770, 988 | "_dstBlendFactor": 771, 989 | "_atlas": null 990 | }, 991 | { 992 | "__type__": "cc.BoxCollider", 993 | "_name": "", 994 | "_objFlags": 0, 995 | "node": { 996 | "__id__": 25 997 | }, 998 | "_enabled": true, 999 | "tag": 0, 1000 | "_offset": { 1001 | "__type__": "cc.Vec2", 1002 | "x": 0, 1003 | "y": 0 1004 | }, 1005 | "_size": { 1006 | "__type__": "cc.Size", 1007 | "width": 10, 1008 | "height": 10 1009 | } 1010 | }, 1011 | { 1012 | "__type__": "7c4c6Rwi4tIC4UMBgYL4231", 1013 | "_name": "", 1014 | "_objFlags": 0, 1015 | "node": { 1016 | "__id__": 25 1017 | }, 1018 | "_enabled": true 1019 | }, 1020 | { 1021 | "__type__": "cc.Node", 1022 | "_name": "line", 1023 | "_objFlags": 0, 1024 | "_opacity": 255, 1025 | "_color": { 1026 | "__type__": "cc.Color", 1027 | "r": 255, 1028 | "g": 255, 1029 | "b": 255, 1030 | "a": 255 1031 | }, 1032 | "_cascadeOpacityEnabled": true, 1033 | "_parent": { 1034 | "__id__": 13 1035 | }, 1036 | "_anchorPoint": { 1037 | "__type__": "cc.Vec2", 1038 | "x": 0.5, 1039 | "y": 1 1040 | }, 1041 | "_contentSize": { 1042 | "__type__": "cc.Size", 1043 | "width": 195, 1044 | "height": 21 1045 | }, 1046 | "_children": [], 1047 | "_rotationX": 0, 1048 | "_rotationY": 0, 1049 | "_scaleX": 1, 1050 | "_scaleY": 1, 1051 | "_position": { 1052 | "__type__": "cc.Vec2", 1053 | "x": 0, 1054 | "y": 48.9 1055 | }, 1056 | "_skewX": 0, 1057 | "_skewY": 0, 1058 | "_localZOrder": 0, 1059 | "_globalZOrder": 0, 1060 | "_tag": -1, 1061 | "_opacityModifyRGB": false, 1062 | "_reorderChildDirty": false, 1063 | "_id": "e92a3NmP6JKQKRkZw69cvlA", 1064 | "_active": true, 1065 | "_components": [ 1066 | { 1067 | "__id__": 30 1068 | } 1069 | ], 1070 | "_prefab": null, 1071 | "groupIndex": 0 1072 | }, 1073 | { 1074 | "__type__": "cc.Sprite", 1075 | "_name": "", 1076 | "_objFlags": 0, 1077 | "node": { 1078 | "__id__": 29 1079 | }, 1080 | "_enabled": true, 1081 | "_spriteFrame": { 1082 | "__uuid__": "9e5a58ab-08d1-40e7-a95c-9b10a6c957d4" 1083 | }, 1084 | "_type": 0, 1085 | "_sizeMode": 0, 1086 | "_fillType": 0, 1087 | "_fillCenter": { 1088 | "__type__": "cc.Vec2", 1089 | "x": 0, 1090 | "y": 0 1091 | }, 1092 | "_fillStart": 0, 1093 | "_fillRange": 0, 1094 | "_isTrimmedMode": true, 1095 | "_srcBlendFactor": 770, 1096 | "_dstBlendFactor": 771, 1097 | "_atlas": null 1098 | }, 1099 | { 1100 | "__type__": "ac9fdFyp49GVKHUgk9/FVli", 1101 | "_name": "", 1102 | "_objFlags": 0, 1103 | "node": { 1104 | "__id__": 13 1105 | }, 1106 | "_enabled": true, 1107 | "line": { 1108 | "__id__": 29 1109 | }, 1110 | "left": { 1111 | "__id__": 21 1112 | }, 1113 | "right": { 1114 | "__id__": 25 1115 | }, 1116 | "linePre": { 1117 | "__uuid__": "6c06dcfd-5838-43be-a8e2-b1d5dee08572" 1118 | }, 1119 | "count": { 1120 | "__id__": 19 1121 | } 1122 | }, 1123 | { 1124 | "__type__": "cc.Node", 1125 | "_name": "Game", 1126 | "_objFlags": 0, 1127 | "_opacity": 255, 1128 | "_color": { 1129 | "__type__": "cc.Color", 1130 | "r": 255, 1131 | "g": 255, 1132 | "b": 255, 1133 | "a": 255 1134 | }, 1135 | "_cascadeOpacityEnabled": true, 1136 | "_parent": { 1137 | "__id__": 2 1138 | }, 1139 | "_anchorPoint": { 1140 | "__type__": "cc.Vec2", 1141 | "x": 0.5, 1142 | "y": 0 1143 | }, 1144 | "_contentSize": { 1145 | "__type__": "cc.Size", 1146 | "width": 0, 1147 | "height": 0 1148 | }, 1149 | "_children": [], 1150 | "_rotationX": 0, 1151 | "_rotationY": 0, 1152 | "_scaleX": 1, 1153 | "_scaleY": 1, 1154 | "_position": { 1155 | "__type__": "cc.Vec2", 1156 | "x": 0, 1157 | "y": 0 1158 | }, 1159 | "_skewX": 0, 1160 | "_skewY": 0, 1161 | "_localZOrder": 0, 1162 | "_globalZOrder": 0, 1163 | "_tag": -1, 1164 | "_opacityModifyRGB": false, 1165 | "_reorderChildDirty": false, 1166 | "_id": "06ee0p1kftDPL030NC/vphA", 1167 | "_active": true, 1168 | "_components": [ 1169 | { 1170 | "__id__": 33 1171 | }, 1172 | { 1173 | "__id__": 34 1174 | }, 1175 | { 1176 | "__id__": 35 1177 | } 1178 | ], 1179 | "_prefab": null, 1180 | "groupIndex": 0 1181 | }, 1182 | { 1183 | "__type__": "7b066H36KxCVr0SNDZka91/", 1184 | "_name": "", 1185 | "_objFlags": 0, 1186 | "node": { 1187 | "__id__": 32 1188 | }, 1189 | "_enabled": true, 1190 | "ball": { 1191 | "__uuid__": "1a0c6b8f-0e87-458b-b3b5-1883407bd152" 1192 | }, 1193 | "shadow": { 1194 | "__uuid__": "1bbb19a9-7123-4517-a59b-3f05fb71799d" 1195 | }, 1196 | "basket": { 1197 | "__id__": 31 1198 | }, 1199 | "startPosition": { 1200 | "__type__": "cc.Vec2", 1201 | "x": 0, 1202 | "y": -450 1203 | }, 1204 | "score": { 1205 | "__id__": 12 1206 | }, 1207 | "soundMng": { 1208 | "__id__": 34 1209 | }, 1210 | "timeMng": { 1211 | "__id__": 35 1212 | } 1213 | }, 1214 | { 1215 | "__type__": "3495eBx+i1PlrOKcbTaqUD6", 1216 | "_name": "", 1217 | "_objFlags": 0, 1218 | "node": { 1219 | "__id__": 32 1220 | }, 1221 | "_enabled": true, 1222 | "toggleAudio": true, 1223 | "scoreAudio": { 1224 | "__uuid__": "252290b4-26d6-4a9f-a2df-26f681b031d4" 1225 | }, 1226 | "ballInAudio": { 1227 | "__uuid__": "50b0cc5c-8951-4245-b74f-81335c79ae3a" 1228 | }, 1229 | "hitBoardInAudio": { 1230 | "__uuid__": "ba477178-7499-4290-816f-d687e652b319" 1231 | }, 1232 | "hitBoardAudio": { 1233 | "__uuid__": "b269023a-f612-4937-8df8-acdf35faa5d0" 1234 | }, 1235 | "flyAudio": { 1236 | "__uuid__": "e1994c28-52cf-4896-87cc-52f9149b6d69" 1237 | } 1238 | }, 1239 | { 1240 | "__type__": "f81cdY3hlNAza/JwLtsWk2O", 1241 | "_name": "", 1242 | "_objFlags": 0, 1243 | "node": { 1244 | "__id__": 32 1245 | }, 1246 | "_enabled": true, 1247 | "maxTime": 30, 1248 | "timeToMove": 5 1249 | }, 1250 | { 1251 | "__type__": "cc.Canvas", 1252 | "_name": "", 1253 | "_objFlags": 0, 1254 | "node": { 1255 | "__id__": 2 1256 | }, 1257 | "_enabled": true, 1258 | "_designResolution": { 1259 | "__type__": "cc.Size", 1260 | "width": 750, 1261 | "height": 1214 1262 | }, 1263 | "_fitWidth": false, 1264 | "_fitHeight": true 1265 | } 1266 | ] -------------------------------------------------------------------------------- /assets/Game.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "bbb8e11b-4e63-45cb-bee5-9f41d96a1271", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/audio.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "28e36ea7-d046-4253-b063-3c596f1db650", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/audio/ballin.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/audio/ballin.mp3 -------------------------------------------------------------------------------- /assets/audio/ballin.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "50b0cc5c-8951-4245-b74f-81335c79ae3a", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/audio/fly.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/audio/fly.mp3 -------------------------------------------------------------------------------- /assets/audio/fly.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "e1994c28-52cf-4896-87cc-52f9149b6d69", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/audio/hitboard.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/audio/hitboard.mp3 -------------------------------------------------------------------------------- /assets/audio/hitboard.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "b269023a-f612-4937-8df8-acdf35faa5d0", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/audio/hitboardin.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/audio/hitboardin.mp3 -------------------------------------------------------------------------------- /assets/audio/hitboardin.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "ba477178-7499-4290-816f-d687e652b319", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/audio/score.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/audio/score.mp3 -------------------------------------------------------------------------------- /assets/audio/score.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "252290b4-26d6-4a9f-a2df-26f681b031d4", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/font.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "aedfec9d-0b28-4874-af38-59e4da1a397c", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/font/mikado_outline_shadow.fnt: -------------------------------------------------------------------------------- 1 | info face="Mikado" size=36 bold=1 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 2 | common lineHeight=49 base=36 scaleW=512 scaleH=256 pages=1 packed=0 3 | page id=0 file="mikado_outline_shadow.png" 4 | chars count=95 5 | char id=32 x=294 y=208 width=0 height=0 xoffset=0 yoffset=40 xadvance=7 page=0 chnl=0 letter="space" 6 | char id=33 x=460 y=132 width=18 height=37 xoffset=1 yoffset=3 xadvance=11 page=0 chnl=0 letter="!" 7 | char id=34 x=131 y=208 width=23 height=22 xoffset=0 yoffset=3 xadvance=15 page=0 chnl=0 letter=""" 8 | char id=35 x=68 y=132 width=31 height=37 xoffset=-0 yoffset=3 xadvance=22 page=0 chnl=0 letter="#" 9 | char id=36 x=122 y=2 width=30 height=44 xoffset=0 yoffset=-1 xadvance=21 page=0 chnl=0 letter="$" 10 | char id=37 x=128 y=51 width=39 height=38 xoffset=-0 yoffset=3 xadvance=30 page=0 chnl=0 letter="%" 11 | char id=38 x=242 y=51 width=33 height=38 xoffset=1 yoffset=3 xadvance=25 page=0 chnl=0 letter="&" 12 | char id=39 x=156 y=208 width=15 height=22 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 letter="'" 13 | char id=40 x=251 y=2 width=23 height=42 xoffset=0 yoffset=3 xadvance=14 page=0 chnl=0 letter="(" 14 | char id=41 x=276 y=2 width=23 height=42 xoffset=-1 yoffset=3 xadvance=14 page=0 chnl=0 letter=")" 15 | char id=42 x=50 y=208 width=23 height=24 xoffset=0 yoffset=1 xadvance=15 page=0 chnl=0 letter="*" 16 | char id=43 x=232 y=171 width=28 height=30 xoffset=-0 yoffset=9 xadvance=19 page=0 chnl=0 letter="+" 17 | char id=44 x=30 y=208 width=18 height=26 xoffset=0 yoffset=21 xadvance=10 page=0 chnl=0 letter="," 18 | char id=45 x=246 y=208 width=22 height=16 xoffset=1 yoffset=16 xadvance=14 page=0 chnl=0 letter="-" 19 | char id=46 x=196 y=208 width=18 height=19 xoffset=0 yoffset=22 xadvance=10 page=0 chnl=0 letter="." 20 | char id=47 x=223 y=2 width=26 height=42 xoffset=-0 yoffset=1 xadvance=17 page=0 chnl=0 letter="/" 21 | char id=48 x=134 y=92 width=30 height=38 xoffset=0 yoffset=3 xadvance=22 page=0 chnl=0 letter="0" 22 | char id=49 x=435 y=132 width=23 height=37 xoffset=-1 yoffset=3 xadvance=15 page=0 chnl=0 letter="1" 23 | char id=50 x=349 y=132 width=27 height=37 xoffset=-0 yoffset=3 xadvance=19 page=0 chnl=0 letter="2" 24 | char id=51 x=351 y=92 width=28 height=38 xoffset=-0 yoffset=2 xadvance=19 page=0 chnl=0 letter="3" 25 | char id=52 x=35 y=132 width=31 height=37 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0 letter="4" 26 | char id=53 x=321 y=92 width=28 height=38 xoffset=-0 yoffset=2 xadvance=19 page=0 chnl=0 letter="5" 27 | char id=54 x=259 y=92 width=29 height=38 xoffset=0 yoffset=2 xadvance=20 page=0 chnl=0 letter="6" 28 | char id=55 x=378 y=132 width=27 height=37 xoffset=-0 yoffset=3 xadvance=17 page=0 chnl=0 letter="7" 29 | char id=56 x=228 y=92 width=29 height=38 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0 letter="8" 30 | char id=57 x=290 y=92 width=29 height=38 xoffset=-0 yoffset=2 xadvance=20 page=0 chnl=0 letter="9" 31 | char id=58 x=456 y=171 width=18 height=30 xoffset=0 yoffset=11 xadvance=10 page=0 chnl=0 letter=":" 32 | char id=59 x=480 y=132 width=18 height=37 xoffset=1 yoffset=10 xadvance=11 page=0 chnl=0 letter=";" 33 | char id=60 x=2 y=208 width=26 height=27 xoffset=-0 yoffset=10 xadvance=17 page=0 chnl=0 letter="<" 34 | char id=61 x=103 y=208 width=26 height=22 xoffset=1 yoffset=13 xadvance=19 page=0 chnl=0 letter="=" 35 | char id=62 x=476 y=171 width=26 height=28 xoffset=0 yoffset=11 xadvance=18 page=0 chnl=0 letter=">" 36 | char id=63 x=381 y=92 width=25 height=38 xoffset=-0 yoffset=2 xadvance=17 page=0 chnl=0 letter="?" 37 | char id=64 x=17 y=2 width=44 height=46 xoffset=0 yoffset=3 xadvance=36 page=0 chnl=0 letter="@" 38 | char id=65 x=427 y=92 width=35 height=37 xoffset=-0 yoffset=3 xadvance=26 page=0 chnl=0 letter="A" 39 | char id=66 x=101 y=132 width=30 height=37 xoffset=1 yoffset=3 xadvance=23 page=0 chnl=0 letter="B" 40 | char id=67 x=2 y=92 width=32 height=38 xoffset=0 yoffset=3 xadvance=23 page=0 chnl=0 letter="C" 41 | char id=68 x=464 y=92 width=32 height=37 xoffset=1 yoffset=3 xadvance=25 page=0 chnl=0 letter="D" 42 | char id=69 x=260 y=132 width=28 height=37 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0 letter="E" 43 | char id=70 x=290 y=132 width=28 height=37 xoffset=1 yoffset=3 xadvance=21 page=0 chnl=0 letter="F" 44 | char id=71 x=312 y=51 width=33 height=38 xoffset=0 yoffset=3 xadvance=25 page=0 chnl=0 letter="G" 45 | char id=72 x=277 y=51 width=33 height=38 xoffset=1 yoffset=3 xadvance=27 page=0 chnl=0 letter="H" 46 | char id=73 x=408 y=92 width=17 height=38 xoffset=1 yoffset=3 xadvance=11 page=0 chnl=0 letter="I" 47 | char id=74 x=407 y=132 width=26 height=37 xoffset=-1 yoffset=3 xadvance=17 page=0 chnl=0 letter="J" 48 | char id=75 x=36 y=92 width=32 height=38 xoffset=1 yoffset=3 xadvance=24 page=0 chnl=0 letter="K" 49 | char id=76 x=320 y=132 width=27 height=37 xoffset=1 yoffset=3 xadvance=19 page=0 chnl=0 letter="L" 50 | char id=77 x=85 y=51 width=41 height=38 xoffset=-0 yoffset=3 xadvance=32 page=0 chnl=0 letter="M" 51 | char id=78 x=417 y=51 width=33 height=38 xoffset=1 yoffset=3 xadvance=27 page=0 chnl=0 letter="N" 52 | char id=79 x=169 y=51 width=35 height=38 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0 letter="O" 53 | char id=80 x=165 y=132 width=30 height=37 xoffset=1 yoffset=3 xadvance=23 page=0 chnl=0 letter="P" 54 | char id=81 x=85 y=2 width=35 height=45 xoffset=0 yoffset=3 xadvance=27 page=0 chnl=0 letter="Q" 55 | char id=82 x=2 y=132 width=31 height=37 xoffset=1 yoffset=4 xadvance=24 page=0 chnl=0 letter="R" 56 | char id=83 x=197 y=132 width=30 height=37 xoffset=-0 yoffset=3 xadvance=21 page=0 chnl=0 letter="S" 57 | char id=84 x=133 y=132 width=30 height=37 xoffset=-1 yoffset=3 xadvance=21 page=0 chnl=0 letter="T" 58 | char id=85 x=452 y=51 width=32 height=38 xoffset=1 yoffset=3 xadvance=26 page=0 chnl=0 letter="U" 59 | char id=86 x=206 y=51 width=34 height=38 xoffset=-1 yoffset=2 xadvance=24 page=0 chnl=0 letter="V" 60 | char id=87 x=40 y=51 width=43 height=38 xoffset=-0 yoffset=3 xadvance=34 page=0 chnl=0 letter="W" 61 | char id=88 x=382 y=51 width=33 height=38 xoffset=-1 yoffset=3 xadvance=23 page=0 chnl=0 letter="X" 62 | char id=89 x=347 y=51 width=33 height=38 xoffset=-1 yoffset=3 xadvance=23 page=0 chnl=0 letter="Y" 63 | char id=90 x=229 y=132 width=29 height=37 xoffset=0 yoffset=3 xadvance=21 page=0 chnl=0 letter="Z" 64 | char id=91 x=200 y=2 width=21 height=43 xoffset=1 yoffset=3 xadvance=13 page=0 chnl=0 letter="[" 65 | char id=92 x=387 y=2 width=25 height=40 xoffset=-0 yoffset=1 xadvance=16 page=0 chnl=0 letter="\" 66 | char id=93 x=301 y=2 width=21 height=42 xoffset=-0 yoffset=3 xadvance=13 page=0 chnl=0 letter="]" 67 | char id=94 x=75 y=208 width=26 height=23 xoffset=-0 yoffset=2 xadvance=17 page=0 chnl=0 letter="^" 68 | char id=95 x=270 y=208 width=22 height=15 xoffset=1 yoffset=30 xadvance=15 page=0 chnl=0 letter="_" 69 | char id=96 x=173 y=208 width=21 height=19 xoffset=1 yoffset=2 xadvance=14 page=0 chnl=0 letter="`" 70 | char id=97 x=321 y=171 width=26 height=30 xoffset=-0 yoffset=10 xadvance=18 page=0 chnl=0 letter="a" 71 | char id=98 x=324 y=2 width=30 height=40 xoffset=-0 yoffset=1 xadvance=21 page=0 chnl=0 letter="b" 72 | char id=99 x=349 y=171 width=26 height=30 xoffset=-0 yoffset=11 xadvance=17 page=0 chnl=0 letter="c" 73 | char id=100 x=414 y=2 width=30 height=39 xoffset=0 yoffset=2 xadvance=22 page=0 chnl=0 letter="d" 74 | char id=101 x=292 y=171 width=27 height=30 xoffset=-0 yoffset=10 xadvance=18 page=0 chnl=0 letter="e" 75 | char id=102 x=476 y=2 width=26 height=39 xoffset=-1 yoffset=2 xadvance=15 page=0 chnl=0 letter="f" 76 | char id=103 x=102 y=92 width=30 height=38 xoffset=0 yoffset=10 xadvance=22 page=0 chnl=0 letter="g" 77 | char id=104 x=446 y=2 width=28 height=39 xoffset=1 yoffset=1 xadvance=21 page=0 chnl=0 letter="h" 78 | char id=105 x=2 y=51 width=17 height=39 xoffset=1 yoffset=1 xadvance=10 page=0 chnl=0 letter="i" 79 | char id=106 x=63 y=2 width=20 height=46 xoffset=-2 yoffset=2 xadvance=10 page=0 chnl=0 letter="j" 80 | char id=107 x=356 y=2 width=29 height=40 xoffset=0 yoffset=1 xadvance=20 page=0 chnl=0 letter="k" 81 | char id=108 x=21 y=51 width=17 height=39 xoffset=1 yoffset=1 xadvance=9 page=0 chnl=0 letter="l" 82 | char id=109 x=68 y=171 width=38 height=30 xoffset=1 yoffset=10 xadvance=31 page=0 chnl=0 letter="m" 83 | char id=110 x=202 y=171 width=28 height=30 xoffset=1 yoffset=10 xadvance=21 page=0 chnl=0 letter="n" 84 | char id=111 x=171 y=171 width=29 height=30 xoffset=-0 yoffset=10 xadvance=20 page=0 chnl=0 letter="o" 85 | char id=112 x=70 y=92 width=30 height=38 xoffset=1 yoffset=10 xadvance=22 page=0 chnl=0 letter="p" 86 | char id=113 x=197 y=92 width=29 height=38 xoffset=0 yoffset=11 xadvance=21 page=0 chnl=0 letter="q" 87 | char id=114 x=431 y=171 width=23 height=30 xoffset=1 yoffset=10 xadvance=14 page=0 chnl=0 letter="r" 88 | char id=115 x=377 y=171 width=25 height=30 xoffset=-0 yoffset=11 xadvance=16 page=0 chnl=0 letter="s" 89 | char id=116 x=2 y=171 width=24 height=35 xoffset=-0 yoffset=6 xadvance=15 page=0 chnl=0 letter="t" 90 | char id=117 x=262 y=171 width=28 height=30 xoffset=1 yoffset=11 xadvance=21 page=0 chnl=0 letter="u" 91 | char id=118 x=108 y=171 width=30 height=30 xoffset=-0 yoffset=11 xadvance=20 page=0 chnl=0 letter="v" 92 | char id=119 x=28 y=171 width=38 height=30 xoffset=-0 yoffset=11 xadvance=29 page=0 chnl=0 letter="w" 93 | char id=120 x=140 y=171 width=29 height=30 xoffset=-1 yoffset=11 xadvance=19 page=0 chnl=0 letter="x" 94 | char id=121 x=166 y=92 width=29 height=38 xoffset=-1 yoffset=10 xadvance=19 page=0 chnl=0 letter="y" 95 | char id=122 x=404 y=171 width=25 height=30 xoffset=-0 yoffset=10 xadvance=16 page=0 chnl=0 letter="z" 96 | char id=123 x=154 y=2 width=21 height=43 xoffset=-1 yoffset=3 xadvance=12 page=0 chnl=0 letter="{" 97 | char id=124 x=2 y=2 width=13 height=47 xoffset=1 yoffset=1 xadvance=7 page=0 chnl=0 letter="|" 98 | char id=125 x=177 y=2 width=21 height=43 xoffset=-0 yoffset=3 xadvance=12 page=0 chnl=0 letter="}" 99 | char id=126 x=216 y=208 width=28 height=18 xoffset=0 yoffset=14 xadvance=20 page=0 chnl=0 letter="~" 100 | -------------------------------------------------------------------------------- /assets/font/mikado_outline_shadow.fnt.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "efeaba4f-2504-4697-8d07-9e3af2446556", 4 | "textureUuid": "36019977-3b67-426c-b1c8-a68b3058a1c1", 5 | "fontSize": 36, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/font/mikado_outline_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/font/mikado_outline_shadow.png -------------------------------------------------------------------------------- /assets/font/mikado_outline_shadow.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "36019977-3b67-426c-b1c8-a68b3058a1c1", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "mikado_outline_shadow": { 9 | "ver": "1.0.3", 10 | "uuid": "6345cdde-4c4a-4c40-a553-6f9250a92a82", 11 | "rawTextureUuid": "36019977-3b67-426c-b1c8-a68b3058a1c1", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -4.5, 16 | "offsetY": 9, 17 | "trimX": 3, 18 | "trimY": 3, 19 | "width": 497, 20 | "height": 232, 21 | "rawWidth": 512, 22 | "rawHeight": 256, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "61988428-f3ec-42d6-990d-7e805b8b9cac", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/prefab/ball.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "ball", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 0.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 195, 33 | "height": 195 34 | }, 35 | "_children": [], 36 | "_rotationX": 0, 37 | "_rotationY": 0, 38 | "_scaleX": 1, 39 | "_scaleY": 1, 40 | "_position": { 41 | "__type__": "cc.Vec2", 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "_skewX": 0, 46 | "_skewY": 0, 47 | "_localZOrder": 0, 48 | "_globalZOrder": 0, 49 | "_tag": -1, 50 | "_opacityModifyRGB": false, 51 | "_id": "", 52 | "_active": true, 53 | "_components": [ 54 | { 55 | "__id__": 2 56 | }, 57 | { 58 | "__id__": 3 59 | }, 60 | { 61 | "__id__": 4 62 | } 63 | ], 64 | "_prefab": { 65 | "__id__": 5 66 | }, 67 | "groupIndex": 1 68 | }, 69 | { 70 | "__type__": "cc.Sprite", 71 | "_name": "", 72 | "_objFlags": 0, 73 | "node": { 74 | "__id__": 1 75 | }, 76 | "_enabled": true, 77 | "_spriteFrame": { 78 | "__uuid__": "28af8cbc-5639-4a34-b437-3c861ecd7007" 79 | }, 80 | "_type": 0, 81 | "_sizeMode": 0, 82 | "_fillType": 0, 83 | "_fillCenter": { 84 | "__type__": "cc.Vec2", 85 | "x": 0, 86 | "y": 0 87 | }, 88 | "_fillStart": 0, 89 | "_fillRange": 0, 90 | "_isTrimmedMode": true, 91 | "_srcBlendFactor": 770, 92 | "_dstBlendFactor": 771, 93 | "_atlas": null 94 | }, 95 | { 96 | "__type__": "05d6195d99B06zz0IIi6csv", 97 | "_name": "", 98 | "_objFlags": 0, 99 | "node": { 100 | "__id__": 1 101 | }, 102 | "_enabled": true, 103 | "emitSpeed": 3000, 104 | "gravity": 4500, 105 | "scale": 0.6, 106 | "showTime": 0.3, 107 | "maxXSpeed": 500 108 | }, 109 | { 110 | "__type__": "cc.CircleCollider", 111 | "_name": "", 112 | "_objFlags": 0, 113 | "node": { 114 | "__id__": 1 115 | }, 116 | "_enabled": true, 117 | "tag": 0, 118 | "_offset": { 119 | "__type__": "cc.Vec2", 120 | "x": 0, 121 | "y": 0 122 | }, 123 | "_radius": 96 124 | }, 125 | { 126 | "__type__": "cc.PrefabInfo", 127 | "root": { 128 | "__id__": 1 129 | }, 130 | "asset": { 131 | "__uuid__": "1a0c6b8f-0e87-458b-b3b5-1883407bd152" 132 | }, 133 | "fileId": "9df02yQlrFBL65ge/kFKklV", 134 | "sync": false 135 | } 136 | ] -------------------------------------------------------------------------------- /assets/prefab/ball.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "1a0c6b8f-0e87-458b-b3b5-1883407bd152", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/prefab/line.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "line", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 1 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 195, 33 | "height": 21 34 | }, 35 | "_children": [ 36 | { 37 | "__id__": 2 38 | } 39 | ], 40 | "_rotationX": 0, 41 | "_rotationY": 0, 42 | "_scaleX": 1, 43 | "_scaleY": 1, 44 | "_position": { 45 | "__type__": "cc.Vec2", 46 | "x": 0, 47 | "y": 43 48 | }, 49 | "_skewX": 0, 50 | "_skewY": 0, 51 | "_localZOrder": 0, 52 | "_globalZOrder": 0, 53 | "_tag": -1, 54 | "_opacityModifyRGB": false, 55 | "_reorderChildDirty": false, 56 | "_id": "", 57 | "_active": true, 58 | "_components": [ 59 | { 60 | "__id__": 5 61 | }, 62 | { 63 | "__id__": 6 64 | } 65 | ], 66 | "_prefab": { 67 | "__id__": 7 68 | }, 69 | "groupIndex": 0 70 | }, 71 | { 72 | "__type__": "cc.Node", 73 | "_name": "net", 74 | "_objFlags": 0, 75 | "_opacity": 255, 76 | "_color": { 77 | "__type__": "cc.Color", 78 | "r": 255, 79 | "g": 255, 80 | "b": 255, 81 | "a": 255 82 | }, 83 | "_cascadeOpacityEnabled": true, 84 | "_parent": { 85 | "__id__": 1 86 | }, 87 | "_anchorPoint": { 88 | "__type__": "cc.Vec2", 89 | "x": 0.5, 90 | "y": 1 91 | }, 92 | "_contentSize": { 93 | "__type__": "cc.Size", 94 | "width": 170, 95 | "height": 89 96 | }, 97 | "_children": [], 98 | "_rotationX": 0, 99 | "_rotationY": 0, 100 | "_scaleX": 1, 101 | "_scaleY": 1, 102 | "_position": { 103 | "__type__": "cc.Vec2", 104 | "x": 0, 105 | "y": -19.3 106 | }, 107 | "_skewX": 0, 108 | "_skewY": 0, 109 | "_localZOrder": 0, 110 | "_globalZOrder": 0, 111 | "_tag": -1, 112 | "_opacityModifyRGB": false, 113 | "_reorderChildDirty": false, 114 | "_id": "", 115 | "_active": true, 116 | "_components": [ 117 | { 118 | "__id__": 3 119 | } 120 | ], 121 | "_prefab": { 122 | "__id__": 4 123 | }, 124 | "groupIndex": 0 125 | }, 126 | { 127 | "__type__": "cc.Sprite", 128 | "_name": "", 129 | "_objFlags": 0, 130 | "node": { 131 | "__id__": 2 132 | }, 133 | "_enabled": true, 134 | "_spriteFrame": { 135 | "__uuid__": "56cf9846-3d49-406d-8569-0b9e4946c647" 136 | }, 137 | "_type": 0, 138 | "_sizeMode": 0, 139 | "_fillType": 0, 140 | "_fillCenter": { 141 | "__type__": "cc.Vec2", 142 | "x": 0, 143 | "y": 0 144 | }, 145 | "_fillStart": 0, 146 | "_fillRange": 0, 147 | "_isTrimmedMode": true, 148 | "_srcBlendFactor": 770, 149 | "_dstBlendFactor": 771, 150 | "_atlas": null 151 | }, 152 | { 153 | "__type__": "cc.PrefabInfo", 154 | "root": { 155 | "__id__": 1 156 | }, 157 | "asset": { 158 | "__uuid__": "6c06dcfd-5838-43be-a8e2-b1d5dee08572" 159 | }, 160 | "fileId": "87a9fkiIglAjLzcyn4FxbZ2" 161 | }, 162 | { 163 | "__type__": "cc.Sprite", 164 | "_name": "", 165 | "_objFlags": 0, 166 | "node": { 167 | "__id__": 1 168 | }, 169 | "_enabled": true, 170 | "_spriteFrame": { 171 | "__uuid__": "9e5a58ab-08d1-40e7-a95c-9b10a6c957d4" 172 | }, 173 | "_type": 0, 174 | "_sizeMode": 0, 175 | "_fillType": 0, 176 | "_fillCenter": { 177 | "__type__": "cc.Vec2", 178 | "x": 0, 179 | "y": 0 180 | }, 181 | "_fillStart": 0, 182 | "_fillRange": 0, 183 | "_isTrimmedMode": true, 184 | "_srcBlendFactor": 770, 185 | "_dstBlendFactor": 771, 186 | "_atlas": null 187 | }, 188 | { 189 | "__type__": "00dcby5FcZIh5P10wPcfVGt", 190 | "_name": "", 191 | "_objFlags": 0, 192 | "node": { 193 | "__id__": 1 194 | }, 195 | "_enabled": true 196 | }, 197 | { 198 | "__type__": "cc.PrefabInfo", 199 | "root": { 200 | "__id__": 1 201 | }, 202 | "asset": { 203 | "__uuid__": "6c06dcfd-5838-43be-a8e2-b1d5dee08572" 204 | }, 205 | "fileId": "78b9bvYJ4xBK6qnJKAjOyEn" 206 | } 207 | ] -------------------------------------------------------------------------------- /assets/prefab/line.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6c06dcfd-5838-43be-a8e2-b1d5dee08572", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/prefab/shadow.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "data": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Node", 13 | "_name": "shadow", 14 | "_objFlags": 0, 15 | "_opacity": 255, 16 | "_color": { 17 | "__type__": "cc.Color", 18 | "r": 255, 19 | "g": 255, 20 | "b": 255, 21 | "a": 255 22 | }, 23 | "_cascadeOpacityEnabled": true, 24 | "_parent": null, 25 | "_anchorPoint": { 26 | "__type__": "cc.Vec2", 27 | "x": 0.5, 28 | "y": 1.5 29 | }, 30 | "_contentSize": { 31 | "__type__": "cc.Size", 32 | "width": 217, 33 | "height": 92 34 | }, 35 | "_children": [ 36 | { 37 | "__id__": 2 38 | } 39 | ], 40 | "_rotationX": 0, 41 | "_rotationY": 0, 42 | "_scaleX": 1, 43 | "_scaleY": 1, 44 | "_position": { 45 | "__type__": "cc.Vec2", 46 | "x": 0, 47 | "y": 0 48 | }, 49 | "_skewX": 0, 50 | "_skewY": 0, 51 | "_localZOrder": 0, 52 | "_globalZOrder": 0, 53 | "_tag": -1, 54 | "_opacityModifyRGB": false, 55 | "_reorderChildDirty": false, 56 | "_id": "", 57 | "_active": true, 58 | "_components": [ 59 | { 60 | "__id__": 5 61 | }, 62 | { 63 | "__id__": 6 64 | } 65 | ], 66 | "_prefab": { 67 | "__id__": 7 68 | }, 69 | "groupIndex": 0 70 | }, 71 | { 72 | "__type__": "cc.Node", 73 | "_name": "shadow2", 74 | "_objFlags": 0, 75 | "_opacity": 255, 76 | "_color": { 77 | "__type__": "cc.Color", 78 | "r": 255, 79 | "g": 255, 80 | "b": 255, 81 | "a": 255 82 | }, 83 | "_cascadeOpacityEnabled": true, 84 | "_parent": { 85 | "__id__": 1 86 | }, 87 | "_anchorPoint": { 88 | "__type__": "cc.Vec2", 89 | "x": 0.5, 90 | "y": 1.8 91 | }, 92 | "_contentSize": { 93 | "__type__": "cc.Size", 94 | "width": 180, 95 | "height": 104 96 | }, 97 | "_children": [], 98 | "_rotationX": 0, 99 | "_rotationY": 0, 100 | "_scaleX": 1, 101 | "_scaleY": 1, 102 | "_position": { 103 | "__type__": "cc.Vec2", 104 | "x": 0, 105 | "y": 0 106 | }, 107 | "_skewX": 0, 108 | "_skewY": 0, 109 | "_localZOrder": 0, 110 | "_globalZOrder": 0, 111 | "_tag": -1, 112 | "_opacityModifyRGB": false, 113 | "_reorderChildDirty": false, 114 | "_id": "", 115 | "_active": true, 116 | "_components": [ 117 | { 118 | "__id__": 3 119 | } 120 | ], 121 | "_prefab": { 122 | "__id__": 4 123 | }, 124 | "groupIndex": 0 125 | }, 126 | { 127 | "__type__": "cc.Sprite", 128 | "_name": "", 129 | "_objFlags": 0, 130 | "node": { 131 | "__id__": 2 132 | }, 133 | "_enabled": true, 134 | "_spriteFrame": { 135 | "__uuid__": "1e98e931-3683-444e-abd5-f0cf040ee6a2" 136 | }, 137 | "_type": 0, 138 | "_sizeMode": 0, 139 | "_fillType": 0, 140 | "_fillCenter": { 141 | "__type__": "cc.Vec2", 142 | "x": 0, 143 | "y": 0 144 | }, 145 | "_fillStart": 0, 146 | "_fillRange": 0, 147 | "_isTrimmedMode": true, 148 | "_srcBlendFactor": 770, 149 | "_dstBlendFactor": 771, 150 | "_atlas": null 151 | }, 152 | { 153 | "__type__": "cc.PrefabInfo", 154 | "root": { 155 | "__id__": 1 156 | }, 157 | "asset": { 158 | "__uuid__": "1bbb19a9-7123-4517-a59b-3f05fb71799d" 159 | }, 160 | "fileId": "" 161 | }, 162 | { 163 | "__type__": "cc.Sprite", 164 | "_name": "", 165 | "_objFlags": 0, 166 | "node": { 167 | "__id__": 1 168 | }, 169 | "_enabled": true, 170 | "_spriteFrame": { 171 | "__uuid__": "a1040ed2-1956-498f-9663-20fca5d6f465" 172 | }, 173 | "_type": 0, 174 | "_sizeMode": 0, 175 | "_fillType": 0, 176 | "_fillCenter": { 177 | "__type__": "cc.Vec2", 178 | "x": 0, 179 | "y": 0 180 | }, 181 | "_fillStart": 0, 182 | "_fillRange": 0, 183 | "_isTrimmedMode": true, 184 | "_srcBlendFactor": 770, 185 | "_dstBlendFactor": 771, 186 | "_atlas": null 187 | }, 188 | { 189 | "__type__": "403b5GGRt5LYYNN87LqlnM7", 190 | "_name": "", 191 | "_objFlags": 0, 192 | "node": { 193 | "__id__": 1 194 | }, 195 | "_enabled": true, 196 | "showTime": 0.3, 197 | "shadow2": { 198 | "__id__": 2 199 | } 200 | }, 201 | { 202 | "__type__": "cc.PrefabInfo", 203 | "root": { 204 | "__id__": 1 205 | }, 206 | "asset": { 207 | "__uuid__": "1bbb19a9-7123-4517-a59b-3f05fb71799d" 208 | }, 209 | "fileId": "7c574qBUsJO+Z2uoNlBit0H" 210 | } 211 | ] -------------------------------------------------------------------------------- /assets/prefab/shadow.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "1bbb19a9-7123-4517-a59b-3f05fb71799d", 4 | "subMetas": {} 5 | } -------------------------------------------------------------------------------- /assets/res.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3cff102f-249a-4540-b6c0-28c4bf2a8626", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/res/basket_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/basket_bg.png -------------------------------------------------------------------------------- /assets/res/basket_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6c8dc04e-15f1-4c9e-9129-68adda918385", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "basket_bg": { 9 | "ver": "1.0.3", 10 | "uuid": "ced09d8f-e82c-4fb7-abda-db9131264e52", 11 | "rawTextureUuid": "6c8dc04e-15f1-4c9e-9129-68adda918385", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 536, 20 | "height": 381, 21 | "rawWidth": 536, 22 | "rawHeight": 381, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/basketball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/basketball.png -------------------------------------------------------------------------------- /assets/res/basketball.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "1194854a-127d-4ba8-a8c2-bec726f58cc1", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "basketball": { 9 | "ver": "1.0.3", 10 | "uuid": "28af8cbc-5639-4a34-b437-3c861ecd7007", 11 | "rawTextureUuid": "1194854a-127d-4ba8-a8c2-bec726f58cc1", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 195, 20 | "height": 194, 21 | "rawWidth": 195, 22 | "rawHeight": 194, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/game_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/game_bg.png -------------------------------------------------------------------------------- /assets/res/game_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "04d77f54-161a-4e8c-92cb-83b8d3fc738c", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "game_bg": { 9 | "ver": "1.0.3", 10 | "uuid": "ff8d133e-c0f6-4cc7-a5fb-f2b33dbc1ed7", 11 | "rawTextureUuid": "04d77f54-161a-4e8c-92cb-83b8d3fc738c", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 750, 20 | "height": 1214, 21 | "rawWidth": 750, 22 | "rawHeight": 1214, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/line.png -------------------------------------------------------------------------------- /assets/res/line.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "1ba38ecb-b23e-4674-9fe2-cdc134c5ba81", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "line": { 9 | "ver": "1.0.3", 10 | "uuid": "9e5a58ab-08d1-40e7-a95c-9b10a6c957d4", 11 | "rawTextureUuid": "1ba38ecb-b23e-4674-9fe2-cdc134c5ba81", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 195, 20 | "height": 21, 21 | "rawWidth": 195, 22 | "rawHeight": 21, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/net.png -------------------------------------------------------------------------------- /assets/res/net.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "3980df36-92b7-47f8-9d1d-2b1149034a0f", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "net": { 9 | "ver": "1.0.3", 10 | "uuid": "56cf9846-3d49-406d-8569-0b9e4946c647", 11 | "rawTextureUuid": "3980df36-92b7-47f8-9d1d-2b1149034a0f", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 2, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 170, 20 | "height": 85, 21 | "rawWidth": 170, 22 | "rawHeight": 89, 23 | "borderTop": 13, 24 | "borderBottom": 20, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/score_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/score_bg.png -------------------------------------------------------------------------------- /assets/res/score_bg.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "73ecbdd3-28b9-4098-bdb9-73a5add90e83", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "score_bg": { 9 | "ver": "1.0.3", 10 | "uuid": "12e97f52-2cc8-447a-b1d9-5c7cc47dc9b7", 11 | "rawTextureUuid": "73ecbdd3-28b9-4098-bdb9-73a5add90e83", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 253, 20 | "height": 123, 21 | "rawWidth": 253, 22 | "rawHeight": 123, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/shadow.png -------------------------------------------------------------------------------- /assets/res/shadow.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "68596970-9f22-488c-96a5-cedb8e5285fd", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "shadow": { 9 | "ver": "1.0.3", 10 | "uuid": "a1040ed2-1956-498f-9663-20fca5d6f465", 11 | "rawTextureUuid": "68596970-9f22-488c-96a5-cedb8e5285fd", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": -3, 17 | "trimX": 0, 18 | "trimY": 16, 19 | "width": 217, 20 | "height": 66, 21 | "rawWidth": 217, 22 | "rawHeight": 92, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/shadow2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/shadow2.png -------------------------------------------------------------------------------- /assets/res/shadow2.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "163c3cf5-1033-450f-bbe6-80403f273c90", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "shadow2": { 9 | "ver": "1.0.3", 10 | "uuid": "1e98e931-3683-444e-abd5-f0cf040ee6a2", 11 | "rawTextureUuid": "163c3cf5-1033-450f-bbe6-80403f273c90", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -3, 16 | "offsetY": 0.5, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 211, 20 | "height": 104, 21 | "rawWidth": 217, 22 | "rawHeight": 105, 23 | "borderTop": 6, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/star.png -------------------------------------------------------------------------------- /assets/res/star.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "88791b56-d07f-4871-be59-471592a79609", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "star": { 9 | "ver": "1.0.3", 10 | "uuid": "a75d9a4c-f98f-4e2f-8bb9-428e8f59b451", 11 | "rawTextureUuid": "88791b56-d07f-4871-be59-471592a79609", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": -1.5, 17 | "trimX": 0, 18 | "trimY": 4, 19 | "width": 60, 20 | "height": 66, 21 | "rawWidth": 60, 22 | "rawHeight": 71, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/res/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/assets/res/time.png -------------------------------------------------------------------------------- /assets/res/time.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a757c0c7-f41f-4544-8e79-76ba5c320a88", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "time": { 9 | "ver": "1.0.3", 10 | "uuid": "9f334b4e-4393-42a5-ad0a-ba45dcb5596c", 11 | "rawTextureUuid": "a757c0c7-f41f-4544-8e79-76ba5c320a88", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": -3.5, 16 | "offsetY": 4.5, 17 | "trimX": 55, 18 | "trimY": 54, 19 | "width": 207, 20 | "height": 88, 21 | "rawWidth": 324, 22 | "rawHeight": 205, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "93ce77a0-bc61-43d8-9824-35428af144c2", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/script/Ball.js: -------------------------------------------------------------------------------- 1 | var TouchStatus = cc.Enum({ 2 | BEGEN: -1, // 按下 3 | ENDED: -1, // 结束 4 | CANCEL: -1 // 取消 5 | }); 6 | 7 | var BallStatus = cc.Enum({ 8 | FLY: -1, // 飞 9 | DOWN: -1, // 落 10 | NONE: -1 // 静止 11 | }); 12 | 13 | cc.Class({ 14 | extends: cc.Component, 15 | 16 | properties: { 17 | emitSpeed: 0, // 发射速度 18 | gravity: 0, // 重力速度 19 | scale: 0, // 缩放系数 20 | showTime: 0, // 生成篮球显示动画时间 21 | maxXSpeed: 0, // 球弹力 22 | }, 23 | 24 | init: function(game){ 25 | this.game = game; 26 | this.registerInput(); 27 | this.enableInput(true); 28 | this.showAnim(); 29 | this.valid = false; 30 | this.status = TouchStatus.CANCEL; 31 | this.currentHorSpeed = 0; 32 | this.currentVerSpeed = 0; 33 | this.target = cc.p(0, 0); 34 | this.node.setScale(1); 35 | this.node.rotation = 0; 36 | this.hitIn = false; 37 | }, 38 | 39 | // 显示动画 40 | showAnim: function(){ 41 | this.node.opacity = 0; 42 | var fade = cc.fadeIn(this.showTime); 43 | this.node.runAction(fade); 44 | }, 45 | 46 | // 注册事件监听 47 | registerInput: function(){ 48 | this.listener = { 49 | event: cc.EventListener.TOUCH_ONE_BY_ONE, 50 | onTouchBegan: function(touch, event) { // 触摸事件开始 51 | this.began = touch.getLocation(); 52 | this.status = TouchStatus.BEGEN; 53 | return true; 54 | }.bind(this), 55 | 56 | onTouchEnded: function (touch, event) { // 触摸事件结束 57 | this.ended = touch.getLocation(); 58 | var distance = cc.pDistance(this.began, this.ended); 59 | 60 | if(distance > 100 && this.began.y < this.ended.y){ 61 | this.status = TouchStatus.ENDED; 62 | this.enableInput(false); 63 | 64 | this.currentVerSpeed = this.emitSpeed; 65 | this.target = this.node.parent.convertToNodeSpaceAR(this.ended); // 记录最后触摸点,根据触摸点偏移计算速度 66 | this.currentHorSpeed = this.target.x * 2; 67 | 68 | this.game.soundMng.playFlySound(); 69 | 70 | this.doAnim(); 71 | this.game.newBall(); 72 | if(this.shadow){ 73 | this.shadow.dimiss(); 74 | } 75 | }else{ 76 | this.status = TouchStatus.CANCEL; 77 | } 78 | }.bind(this), 79 | 80 | onTouchCancelled: function (touch, event) { // 触摸事件取消 81 | this.status = TouchStatus.CANCEL; 82 | }.bind(this) 83 | }, 84 | cc.eventManager.addListener(this.listener, this.node); 85 | }, 86 | 87 | // 控制事件是否生效 88 | enableInput: function (enable) { 89 | if (enable) { 90 | cc.eventManager.resumeTarget(this.node); 91 | } else { 92 | cc.eventManager.pauseTarget(this.node); 93 | } 94 | }, 95 | 96 | // 篮球动画 97 | doAnim: function(){ 98 | var scaleAnim = cc.scaleTo(1, this.scale); 99 | var rotateValue = cc.randomMinus1To1(); 100 | var rotateAnim = cc.rotateBy(2, 3*360*rotateValue); 101 | var anim = cc.spawn(scaleAnim,rotateAnim); 102 | this.node.runAction(anim); 103 | }, 104 | 105 | update: function (dt) { 106 | if(this.status != TouchStatus.ENDED){ 107 | return; 108 | } 109 | 110 | this._updatePosition(dt); 111 | this._checkValid(); 112 | }, 113 | 114 | _checkValid: function(){ 115 | if(this.ballStatus !== BallStatus.DOWN || this.valid){ 116 | return; 117 | } 118 | 119 | var parent = this.node.parent; 120 | if(parent != null){ 121 | var basket = this.game.basket; 122 | var left = basket.left; 123 | var right = basket.right; 124 | var ballRadius = this.node.getBoundingBoxToWorld().width/2; 125 | 126 | /** 统一转换成世界坐标计算进球逻辑 */ 127 | // 篮球的边界和中心 128 | var ballLeft = parent.convertToWorldSpaceAR(this.node.getPosition()).x - ballRadius; 129 | var ballRight = parent.convertToWorldSpaceAR(this.node.getPosition()).x + ballRadius; 130 | var ballX = parent.convertToWorldSpaceAR(this.node.getPosition()).x; 131 | var ballY = parent.convertToWorldSpaceAR(this.node.getPosition()).y; 132 | 133 | // 有效进球范围 134 | var validTop = parent.convertToWorldSpaceAR(basket.linePreNode.getPosition()).y - ballRadius; 135 | var validLeft = basket.node.convertToWorldSpaceAR(left.getPosition()).x; 136 | var validRight = basket.node.convertToWorldSpaceAR(right.getPosition()).x; 137 | var validBot = basket.node.convertToWorldSpaceAR(left.getPosition()).y - ballRadius * 2; 138 | 139 | if(ballY < validTop && ballY > validBot && ballX > validLeft && ballX < validRight){ 140 | this.valid = true; 141 | this.game.score.addScore(); 142 | this.game.basket.playNetAnim(); 143 | if(this.hitIn){ 144 | this.game.soundMng.playHitBoardInSound(); 145 | }else{ 146 | this.game.soundMng.playBallInSound(); 147 | } 148 | } 149 | } 150 | }, 151 | 152 | // 篮球绑定自己的影子 153 | bindShadow: function(shadow){ 154 | this.shadow = shadow; 155 | }, 156 | 157 | // 更新篮球位置 158 | _updatePosition: function(dt){ 159 | this.node.x += dt * this.currentHorSpeed; 160 | 161 | this.currentVerSpeed -= dt * this.gravity; 162 | this.node.y += dt * this.currentVerSpeed; 163 | 164 | this._changeBallStatus(this.currentVerSpeed); 165 | 166 | if(this.ballStatus === BallStatus.NONE && this._isOutScreen()){ 167 | // if(!this.valid){ // 没进球将分数重置 168 | // this.game.score.setScore(0); 169 | // } 170 | 171 | this.node.stopAllActions(); 172 | this.node.removeFromParent(); 173 | this.valid = false; 174 | cc.pool.putInPool(this); 175 | // this.game.newBall(); 176 | return; 177 | } 178 | }, 179 | 180 | _isOutScreen: function(){ 181 | return this.node.y < -800; 182 | }, 183 | 184 | // 更改篮球状态 185 | _changeBallStatus: function(speed){ 186 | if(speed === 0 || this._isOutScreen()){ 187 | this.ballStatus = BallStatus.NONE; 188 | } else if(speed > 0) { 189 | this.ballStatus = BallStatus.FLY; 190 | this.game.basket.switchMaskLineShow(false); 191 | } else { 192 | this.ballStatus = BallStatus.DOWN; 193 | this.game.basket.switchMaskLineShow(true); 194 | } 195 | }, 196 | 197 | onCollisionEnter: function (other, self) { 198 | if(this.ballStatus === BallStatus.FLY){ // 篮球上升过程中不进行碰撞检测 199 | return; 200 | } 201 | 202 | var box = other.node.getComponent('CollisionBox'); 203 | var left = box.getLeft(); 204 | var right = box.getRight(); 205 | 206 | // 碰撞系统会计算出碰撞组件在世界坐标系下的相关的值,并放到 world 这个属性里面 207 | var world = self.world; 208 | var radius = world.radius; 209 | 210 | // 换算物体世界坐标系坐标 211 | var selfWorldPot = this.node.parent.convertToWorldSpaceAR(self.node.getPosition()); 212 | var otherWorldPot = this.game.basket.node.convertToWorldSpaceAR(other.node.getPosition()); 213 | 214 | // 将碰撞范围抽象成篮筐左右两个点,并将这两点与篮球放到同一个碰撞组。 215 | // 篮球中心点到刚体中心点距离除以篮球半径得到一个比值,横纵向乘以这个比值得到横纵向速度。 216 | var ratioVer = (selfWorldPot.y - otherWorldPot.y) / radius; 217 | var ratioHor = Math.abs(otherWorldPot.x - selfWorldPot.x) / radius; 218 | // 水平方向碰撞最大初速度 219 | var horV = this.currentHorSpeed / Math.abs(this.currentHorSpeed) * this.maxXSpeed; 220 | 221 | // 篮球碰到篮筐内,改变篮球横向速度为反方向 222 | if ((other.node.name === 'right' && this.node.x <= left) || (other.node.name === 'left' && this.node.x >= right)) { 223 | if (!this.hitIn) { 224 | this.currentHorSpeed = horV * -1 * ratioHor; 225 | this.hitIn = true; 226 | } else { 227 | this.currentHorSpeed = horV * ratioHor; 228 | } 229 | } 230 | 231 | // 篮球碰到篮筐外,增大横向速度 232 | if ((other.node.name === 'right' && this.node.x > right) || (other.node.name === 'left' && this.node.x < left)) { 233 | this.currentHorSpeed = horV; 234 | } 235 | this.currentVerSpeed = this.currentVerSpeed * -1 * ratioVer; 236 | this.game.soundMng.playHitBoardSound(); 237 | 238 | // 碰撞组件的 aabb 碰撞框 239 | var aabb = world.aabb; 240 | 241 | // 上一次计算的碰撞组件的 aabb 碰撞框 242 | var preAabb = world.preAabb; 243 | 244 | // 碰撞框的世界矩阵 245 | var t = world.transform; 246 | 247 | // 以下属性为圆形碰撞组件特有属性 248 | var r = world.radius; 249 | var p = world.position; 250 | }, 251 | 252 | }); -------------------------------------------------------------------------------- /assets/script/Ball.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "05d61f79-77df-41d3-acf3-d08222e9cb2f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/Basket.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | line: cc.Node, 6 | left: cc.Node, 7 | right: cc.Node, 8 | linePre: cc.Prefab, 9 | count: cc.Label, 10 | }, 11 | 12 | init: function (game) { 13 | this.game = game; 14 | //this._doMoveAnim(); 15 | this._createMaskLine(); 16 | }, 17 | 18 | startMove: function(){ 19 | this._doMoveAnim(); 20 | }, 21 | 22 | stopMove: function(){ 23 | this.node.stopAllActions(); 24 | this._resetPosition(); 25 | }, 26 | 27 | _resetPosition: function(){ 28 | this.node.setPositionX(0); 29 | }, 30 | 31 | // 篮筐移动动画 32 | _doMoveAnim: function(){ 33 | var moveRight = cc.moveBy(3, cc.p(200, 0)); 34 | var moveLeft = cc.moveBy(3, cc.p(-200, 0)); 35 | var repeat = cc.repeatForever(cc.sequence(moveRight, moveLeft, moveLeft, moveRight)); 36 | this.node.runAction(repeat); 37 | }, 38 | 39 | update: function (dt) { 40 | if(this.line){ 41 | 42 | } 43 | // 修改遮罩位置,先进行坐标转换 44 | var worldPot = this.node.convertToWorldSpaceAR(this.line.getPosition()); 45 | var nodePot = this.node.parent.convertToNodeSpaceAR(worldPot); 46 | this.linePreNode.setPosition(cc.p(this.node.x, nodePot.y)); 47 | }, 48 | 49 | // 创建篮筐遮罩 50 | _createMaskLine: function(){ 51 | this.linePreNode = cc.instantiate(this.linePre); 52 | this.game.node.addChild(this.linePreNode); 53 | }, 54 | 55 | // 切换篮筐遮罩层级 56 | switchMaskLineShow: function(flag){ 57 | if(flag){ 58 | this.linePreNode.setLocalZOrder(100); 59 | }else{ 60 | this.linePreNode.setLocalZOrder(0); 61 | } 62 | }, 63 | 64 | // 球网动画 65 | playNetAnim: function(){ 66 | if(this.linePreNode){ 67 | var scaleLong = cc.scaleTo(0.1, 1, 1.1); 68 | var scaleShort = cc.scaleTo(0.3, 1, 0.9); 69 | var scaleNomal = cc.scaleTo(0.2, 1, 1); 70 | 71 | var anim = cc.sequence(scaleLong,scaleShort,scaleNomal); 72 | this.linePreNode.getChildByName('net').runAction(anim); 73 | } 74 | }, 75 | }); 76 | -------------------------------------------------------------------------------- /assets/script/Basket.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "ac9fd172-a78f-4654-a1d4-824f7f155962", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/CollisionBox.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | }, 6 | 7 | // 获取刚体左边界 8 | getLeft: function(){ 9 | return this.node.x - this.node.width/2; 10 | }, 11 | 12 | // 获取刚体右边界 13 | getRight: function(){ 14 | return this.node.x + this.node.width/2; 15 | }, 16 | 17 | // 获取刚体的世界坐标 18 | getWorldPoint: function(target){ 19 | return target.convertToWorldSpaceAR(this.node.getPosition()); 20 | }, 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /assets/script/CollisionBox.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "7c4c6470-8b8b-480b-850c-06060be36df5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/GameManager.js: -------------------------------------------------------------------------------- 1 | var Basket = require('Basket'); 2 | var Ball = require('Ball'); 3 | var Shadow = require('Shadow'); 4 | var Score = require('Score'); 5 | var SoundManager = require('SoundManager'); 6 | var TimeManager = require('TimeManager'); 7 | 8 | cc.Class({ 9 | extends: cc.Component, 10 | 11 | properties: { 12 | ball: cc.Prefab, 13 | shadow: cc.Prefab, 14 | basket: Basket, 15 | startPosition: cc.Vec2, 16 | score: Score, 17 | soundMng: SoundManager, 18 | timeMng: TimeManager, 19 | }, 20 | 21 | onLoad: function () { 22 | this.newBall(); 23 | this.initCollisionSys(); 24 | this.basket.init(this); 25 | this.score.init(this); 26 | this.timeMng.init(this); 27 | 28 | this.timeMng.oneSchedule(); 29 | 30 | this.score.setScore(0); 31 | }, 32 | 33 | // 初始化碰撞系统 34 | initCollisionSys: function(){ 35 | this.collisionManager = cc.director.getCollisionManager(); 36 | this.collisionManager.enabled = true; 37 | //this.collisionManager.enabledDebugDraw = true// 开启debug绘制 38 | 39 | cc.director.setDisplayStats(true); 40 | }, 41 | 42 | // 生成篮球 43 | newBall: function(){ 44 | var child = null; 45 | if(cc.pool.hasObject(Ball)){ 46 | child = cc.pool.getFromPool(Ball).node; 47 | }else{ 48 | child = cc.instantiate(this.ball); 49 | } 50 | 51 | child.setLocalZOrder(1); 52 | this.node.addChild(child); 53 | child.setPosition(this.startPosition); 54 | var ballComp = child.getComponent('Ball'); 55 | ballComp.init(this); // 启动篮球逻辑 56 | this.newShadow(ballComp); 57 | }, 58 | 59 | newShadow: function(ball){ 60 | var ballShadow = null; 61 | if(cc.pool.hasObject(Shadow)){ 62 | ballShadow = cc.pool.getFromPool(Shadow).node; 63 | }else{ 64 | ballShadow = cc.instantiate(this.shadow); 65 | } 66 | 67 | ballShadow.setLocalZOrder(2); 68 | this.node.addChild(ballShadow); 69 | ballShadow.setPosition(this.startPosition); 70 | var shadowComp = ballShadow.getComponent('Shadow') 71 | ball.bindShadow(shadowComp); 72 | shadowComp.init(this); // 启动影子逻辑 73 | }, 74 | 75 | startMoveBasket: function(){ 76 | this.basket.startMove(); 77 | }, 78 | 79 | stopMoveBasket: function(){ 80 | this.basket.stopMove(); 81 | }, 82 | 83 | // 游戏结束 84 | gameOver: function(){ 85 | this.score.setScore(0); 86 | }, 87 | 88 | }); 89 | -------------------------------------------------------------------------------- /assets/script/GameManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "7b0661f7-e8ac-4256-bd12-3436646bdd7f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/Line.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, 7 | // url: cc.Texture2D, // optional, default is typeof default 8 | // serializable: true, // optional, default is true 9 | // visible: true, // optional, default is true 10 | // displayName: 'Foo', // optional 11 | // readonly: false, // optional, default is false 12 | // }, 13 | // ... 14 | }, 15 | 16 | // use this for initialization 17 | onLoad: function () { 18 | 19 | }, 20 | 21 | // called every frame, uncomment this function to activate update callback 22 | // update: function (dt) { 23 | // cc.log('line x='+this.node.x+',y='+this.node.y); 24 | // }, 25 | }); 26 | -------------------------------------------------------------------------------- /assets/script/Line.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "00dcbcb9-15c6-4887-93f5-d303dc7d51ad", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/Score.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | scoreText: cc.Label, 6 | }, 7 | 8 | init: function (game) { 9 | this.game = game; 10 | this._score = 0; 11 | }, 12 | 13 | // 获取分数 14 | getScore: function(){ 15 | return _score; 16 | }, 17 | 18 | // 设置分数 19 | setScore: function(score){ 20 | this._score = score; 21 | this._updateScore(); 22 | }, 23 | 24 | // 增加分数 25 | addScore: function(){ 26 | this._score += 1; 27 | this._updateScore(); 28 | 29 | //this.game.soundMng.playScoreSound(); 30 | }, 31 | 32 | // 更新分数 33 | _updateScore: function(){ 34 | this.scoreText.string = this._score; 35 | }, 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /assets/script/Score.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "0dbadf27-b8c0-4af0-be18-5a56b9d118d3", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/Shadow.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | showTime: 0, // 生成篮球显示动画时间 6 | shadow2: cc.Node, 7 | }, 8 | 9 | init: function (game) { 10 | this.node.setScale(1); 11 | this._showAnim(); 12 | }, 13 | 14 | // 显示动画 15 | _showAnim: function(){ 16 | this.node.opacity = 0; 17 | this.shadow2.active = true; 18 | var fadeAnim = cc.fadeIn(this.showTime); 19 | this.node.runAction(fadeAnim); 20 | }, 21 | 22 | dimiss: function(){ 23 | this._dismissAnim(); 24 | }, 25 | 26 | _dismissAnim: function(){ 27 | this.shadow2.active = false; 28 | var fadeAnim = cc.fadeOut(this.showTime); 29 | var scaleAnim = cc.scaleTo(this.showTime, 0.5); 30 | var spawnAnim = cc.spawn(fadeAnim, scaleAnim); 31 | var func = cc.callFunc(this._callBack.bind(this)); 32 | 33 | this.node.runAction(cc.sequence(spawnAnim, func)); 34 | }, 35 | 36 | // 动画结束回调 37 | _callBack: function(){ 38 | this.node.stopAllActions(); 39 | this.node.removeFromParent(); 40 | cc.pool.putInPool(this); 41 | }, 42 | }); 43 | -------------------------------------------------------------------------------- /assets/script/Shadow.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "403b5186-46de-4b61-834d-f3b2ea96733b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/SoundManager.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | toggleAudio: true, 6 | 7 | scoreAudio: { 8 | default: null, 9 | url: cc.AudioClip 10 | }, 11 | 12 | ballInAudio: { 13 | default: null, 14 | url: cc.AudioClip 15 | }, 16 | 17 | hitBoardInAudio: { 18 | default: null, 19 | url: cc.AudioClip 20 | }, 21 | 22 | hitBoardAudio: { 23 | default: null, 24 | url: cc.AudioClip 25 | }, 26 | 27 | flyAudio: { 28 | default: null, 29 | url: cc.AudioClip 30 | }, 31 | }, 32 | 33 | init: function (game) { 34 | 35 | }, 36 | 37 | // 播放得分音效 38 | playScoreSound: function () { 39 | this.playSound(this.scoreAudio); 40 | }, 41 | 42 | // 播放直接进球音效 43 | playBallInSound: function () { 44 | this.playSound(this.ballInAudio); 45 | }, 46 | 47 | // 播放打框音效 48 | playHitBoardSound: function () { 49 | this.playSound(this.hitBoardAudio); 50 | }, 51 | 52 | // 播放打框进球音效 53 | playHitBoardInSound: function () { 54 | this.playSound(this.hitBoardInAudio); 55 | }, 56 | 57 | // 播放投掷音效 58 | playFlySound: function () { 59 | this.playSound(this.flyAudio); 60 | }, 61 | 62 | // 播放音效(不循环) 63 | playSound: function (sound) { 64 | if(this.toggleAudio){ 65 | cc.audioEngine.playEffect(sound, false); 66 | } 67 | }, 68 | }); 69 | -------------------------------------------------------------------------------- /assets/script/SoundManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "3495e071-fa2d-4f96-b38a-71b4daa940fa", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/script/TimeManager.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | maxTime: 0, 6 | timeToMove: 0, 7 | }, 8 | 9 | init: function (game) { 10 | this.game = game; 11 | this.time = this.maxTime; 12 | this.isTimeToMove = false; 13 | }, 14 | 15 | _callback: function(){ 16 | this.counting = false; 17 | this.game.basket.count.string = '00 00'; 18 | this.game.stopMoveBasket(); 19 | this.game.gameOver(); 20 | }, 21 | 22 | stopCounting: function () { 23 | this.unschedule(this._callback); 24 | this.time = this.maxTime; 25 | }, 26 | 27 | oneSchedule: function () { 28 | this.stopCounting(); 29 | this.scheduleOnce(this._callback, this.maxTime); 30 | this.counting = true; 31 | }, 32 | 33 | // called every frame 34 | update: function (dt) { 35 | if (this.counting && this.time > 0) { 36 | this.time -= dt; 37 | if(this.maxTime - this.timeToMove >= this.time && !this.isTimeToMove){ 38 | this.isTimeToMove = true; 39 | this.game.startMoveBasket(); 40 | } 41 | 42 | let text = this.time.toFixed(2) 43 | if(text.length === 4){ 44 | text = '0'+text; 45 | } 46 | this.game.basket.count.string = text.replace('.', ' '); 47 | } 48 | }, 49 | }); 50 | -------------------------------------------------------------------------------- /assets/script/TimeManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "f81cd637-8653-40cd-afc9-c0bb6c5a4d8e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /screenshot/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/screenshot/screenshot1.png -------------------------------------------------------------------------------- /screenshot/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/screenshot/screenshot2.png -------------------------------------------------------------------------------- /screenshot/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/screenshot/screenshot3.png -------------------------------------------------------------------------------- /screenshot/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/screenshot/screenshot4.png -------------------------------------------------------------------------------- /screenshot/screenshot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liang3472/BasketBall/25bcea79bdcba887ad112656dbf5ee336911412c/screenshot/screenshot5.png -------------------------------------------------------------------------------- /settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeScenes": [], 3 | "orientation": { 4 | "landscapeLeft": true, 5 | "landscapeRight": true, 6 | "portrait": false, 7 | "upsideDown": false 8 | }, 9 | "packageName": "org.cocos2d.BasketBall", 10 | "startScene": "bbb8e11b-4e63-45cb-bee5-9f41d96a1271", 11 | "title": "BasketBall", 12 | "webOrientation": "auto" 13 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "collision-matrix": [ 3 | [ 4 | false, 5 | false, 6 | false 7 | ], 8 | [ 9 | false, 10 | false, 11 | true 12 | ], 13 | [ 14 | false, 15 | true, 16 | false 17 | ] 18 | ], 19 | "group-list": [ 20 | "default", 21 | "ball", 22 | "box" 23 | ], 24 | "start-scene": "bbb8e11b-4e63-45cb-bee5-9f41d96a1271", 25 | "excluded-modules": [] 26 | } --------------------------------------------------------------------------------