PlayerState.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. CurrentSpeed:300,
  50. MaxSpeed:800,
  51. BDrawYellowLine:false,
  52. Barrier:null,
  53. enableTouch:true,
  54. TouchControlEnableTouch:true,
  55. StayInFrontLongAccelerationBand:null,
  56. SyschroAtionArray:[],
  57. HeroPositionX:0,
  58. HeroCurrentSpeed:0,
  59. //终点加分 todo
  60. TerminalPoint:0,
  61. //才到家俗点
  62. AchievementPoint:1,
  63. EndDistance:0,//最终的距离
  64. JumpTimer:0,//跳远用到的时间
  65. AtStartLinePositionX:0,
  66. StartLineStopPositionArray:[],
  67. FinishLineReduceSpeedPositionArray:[],
  68. JavePositionArray_Hero:[],
  69. JavePositionArray_Rivel:[]
  70. },
  71. onLoad ()
  72. {
  73. this.BTouchedScreenInTheZone =false;
  74. this.MaxSpeed=900;
  75. },
  76. start()
  77. {
  78. this.HeroPositionX = this.node.position.x;
  79. this.HeroCurrentSpeed = this.CurrentSpeed;
  80. this.CurrentInZoneType = 0;
  81. this.FinishLineReduceSpeedPositionArray=[];
  82. this.JavePositionArray_Hero=[];
  83. this.JavePositionArray_Rivel=[];
  84. }
  85. });
  86. module.exports = {
  87. ColliderSpeedUpPoint : ColliderSpeedUpPoint,
  88. ZoneType :cc.Enum(ZoneType),
  89. SpeedRangeForAnimation:SpeedRangeForAnimation,
  90. };