GameStates.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const GameProgress = cc.Enum ({
  2. default:0,
  3. Race:1,
  4. LongJump:2,
  5. Hurdle:3,
  6. RideBike:4,
  7. Javelin:5,
  8. });
  9. cc.Class({
  10. extends: cc.Component,
  11. properties: {
  12. CurrentTime:0,
  13. CurrentProgress: {
  14. default : GameProgress.Race,
  15. type : cc.Enum(GameProgress)
  16. },
  17. HostName:'',
  18. BWaitingToConnect:false,
  19. bConnect:false,
  20. bReadyToRun:false,
  21. BStartGame:false,
  22. myRandomc : [],
  23. EnterStartLinePlayersArray:[],
  24. EnterFinishLinePlayersArray:[],
  25. EndLinePositionX:0,
  26. StartLinePositionX:0,
  27. ReadyToRunDuration:2,
  28. bPreTransport:false,
  29. bStopAllAnimationAndSchedule:false,
  30. bSyncPositionXRange:10,
  31. //是不是机器人
  32. isRobot:false
  33. },
  34. start () {
  35. this.bConnect=false;
  36. this.bReadyToRun=false;
  37. this.myRandomc = [];
  38. this.StartLinePositionX = 0;
  39. this.bStopAllAnimationAndSchedule = false;
  40. this.isRobot = false;
  41. },
  42. // update : function (dt) {
  43. // // cc.log('CurrentProgress='+this.CurrentProgress);
  44. // },
  45. getMyRandomc : function () {
  46. return this.myRandomc;
  47. }
  48. });
  49. var myRandomcs = {
  50. myRandomc : []
  51. }
  52. module.exports = {
  53. GameProgress : cc.Enum(GameProgress),
  54. myRandomc :myRandomcs.myRandomc
  55. };