BasePlayerStates.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var playerConfig = require("../PlayerConfig.js");
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. bMain: {
  6. default: false,
  7. },
  8. },
  9. onLoad() {
  10. this.init();
  11. },
  12. init()
  13. {
  14. this.playerAnimState = {
  15. default: 0,
  16. idle: 1,
  17. run: 2,
  18. jump: 3,
  19. stagger:4,
  20. };
  21. //playerProgressStates
  22. this.pProStates = {
  23. default: 0,
  24. gaming: 1,
  25. intoEnd: 2,
  26. end: 3,
  27. };
  28. //currentProgressState
  29. this.currentProState = this.pProStates.default;
  30. this.currentState = this.playerAnimState.idle;
  31. this.currentSpeed = playerConfig.playerSpeedGrade.idle;
  32. //next change map target position x
  33. this.targetPoint = 360;
  34. //SpeedGrade for change running state animation
  35. this.currentSpeedGrade = playerConfig.playerSpeedGrade.idle;
  36. this.passedHurdrailNum = 0;
  37. this.handrailArr = [];
  38. this.nextHandrail = null;
  39. }
  40. });