HurdleStart.js 728 B

123456789101112131415161718192021222324252627282930313233
  1. const GameStatesStatic = require('GameStates');
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. },
  6. start () {
  7. },
  8. onCollisionEnter: function (other)
  9. {
  10. if(other.node.name === 'PlayerCollisionLine')
  11. {
  12. var Level = this.node.parent.parent;
  13. var Canvas = Level.getComponent('LevelControl').Canvas;
  14. var GameStates = Canvas.getComponent('GameStates');
  15. GameStates.CurrentProgress = GameStatesStatic.GameProgress.Hurdle;
  16. // cc.log('Hur='+GameStates.CurrentProgress);
  17. }
  18. },
  19. onCollisionStay: function (other) {
  20. // console.log('on collision stay');
  21. },
  22. onCollisionExit: function (other) {
  23. }
  24. });