Untitled


SUBMITTED BY: Guest

DATE: Oct. 17, 2016, 11:53 p.m.

FORMAT: Text only

SIZE: 695 Bytes

HITS: 745

  1. // calculate movement
  2. carLeftEdge += changeInCarPos;
  3. if (carLeftEdge < 0)
  4. carLeftEdge = 0;
  5. else if (carLeftEdge > (PLAYERAWIDTH - BLOCKSIZE))
  6. carLeftEdge = PLAYAREAWIDTH - BLOCKSIZE;
  7. randomDiceThrow = Math.random();
  8. if (roadDiceThrow < ROADGOESLEFT) changeInCarPos = -ANIMDELTA;
  9. else if (randomDiceThrow >= ROADGOESRIGHT) changeInCarPos = ANIMDELTA;
  10. else changeInCarPos
  11. changedLeftRoadEdge += changeInRoadPos;
  12. if (changedLeftRoadEdge < 0)
  13. changedLeftRoadEdge = 0;
  14. else if (changedLeftRoadEdge > PLAYAREAWIDTH - ROADWIDTH)
  15. changedLeftRoadEdge = PLAYAREAWIDTH - ROADWIDTH;
  16. for (roadPiece = NUMROADPIECES - 1; r)

comments powered by Disqus