PlayerState.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const ColliderSpeedUpPoint = ({
  2. None:0,
  3. FrontAccelerationBand:80,
  4. AccelerationBandCenter:150,
  5. BehindAccelerationBand:80,
  6. PreHurdleBand:200,
  7. PerfectHurdleBand:220,
  8. FrontLongAccelerationBand:80,
  9. CenterLongAccelerationBand:5,
  10. FrontLongJumpBand:80,
  11. PerfectLongJumpBand:150,
  12. });
  13. const ZoneType = cc.Enum ({
  14. None:0,
  15. FrontAccelerationBand:1,
  16. AccelerationBandCenter:2,
  17. BehindAccelerationBand:3,
  18. PreHurdleBand:4,
  19. PerfectHurdleBand:5,
  20. FrontLongAccelerationBand:6,
  21. CenterLongAccelerationBand:7,
  22. BehindLongAccelerationBand:8,
  23. FrontLongJumpBand:9,
  24. PerfectLongJumpBand:10,
  25. });
  26. const SpeedRangeForAnimation = ({
  27. SlowSpeed:[0,300],
  28. MiddleSpeed:[300,600],
  29. HightSpeed:[600,1500],
  30. });
  31. // 7920
  32. // 20880
  33. // 34560
  34. // 54000
  35. // 64076.4
  36. cc.Class({
  37. extends: cc.Component,
  38. properties: {
  39. CurrentInZoneType : {
  40. default : ZoneType.None,
  41. type : cc.Enum(ZoneType)
  42. },
  43. BTouchedScreenInTheZone:false,
  44. BTouchedScreenInTheZone_jumpLong:false,
  45. BStagger:false,
  46. AccelerationBandCenterTouched:null,
  47. InitialPositionY:0,
  48. InitialSpeed:300,
  49. DownSpeed : 100,
  50. CurrentSpeed:300,
  51. LastSpeed:0,
  52. MaxSpeed:800,
  53. BDrawYellowLine:false,
  54. Barrier:null,
  55. enableTouch:true,
  56. TouchControlEnableTouch:true,
  57. StayInFrontLongAccelerationBand:null,
  58. SyschroAtionArray:[],
  59. HeroPositionX:0,
  60. HeroCurrentSpeed:0,
  61. //终点加分 todo
  62. TerminalPoint:0,
  63. //才到家俗点
  64. AchievementPoint:1,
  65. EndDistance:0,//最终的距离
  66. JumpTimer:0,//跳远用到的时间
  67. AtStartLinePositionX:0,
  68. StartLineStopPositionArray:[],
  69. FinishLineReduceSpeedPositionArray:[],
  70. JavePositionArray_Hero:[],
  71. JavePositionArray_Rivel:[],
  72. },
  73. onLoad ()
  74. {
  75. this.BTouchedScreenInTheZone =false;
  76. this.MaxSpeed=900;
  77. },
  78. start()
  79. {
  80. this.HeroPositionX = this.node.position.x;
  81. this.HeroCurrentSpeed = this.CurrentSpeed;
  82. this.CurrentInZoneType = 0;
  83. this.FinishLineReduceSpeedPositionArray=[];
  84. this.JavePositionArray_Hero=[];
  85. this.JavePositionArray_Rivel=[];
  86. }
  87. });
  88. module.exports = {
  89. ColliderSpeedUpPoint : ColliderSpeedUpPoint,
  90. ZoneType :cc.Enum(ZoneType),
  91. SpeedRangeForAnimation:SpeedRangeForAnimation,
  92. };