Advertisement
Guest User

test

a guest
Aug 31st, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1.  
  2. var showHelp = function() {
  3. clear();
  4. removeAllListener();
  5. canvas.style.cursor = "default";
  6. ctx.fillStyle = "black";
  7. ctx.font = "100px" + font;
  8. ctx.fillText("help", 120, 80);
  9.  
  10. ctx.font = "12px" + font;
  11. ctx.textAlign = "left";
  12. ctx.fillStyle = "black";
  13. ctx.fillRect(50, 100, 20, 20);
  14. ctx.fillStyle = "#111111";
  15. ctx.fillText("this is your square. it is controlled by the mouse.", 90, 114);
  16. ctx.fillStyle = "red";
  17. ctx.fillRect(50, 140, 20, 20);
  18. ctx.fillStyle = "#111111";
  19. ctx.fillText("this is an enemy. if you hit one of these, you lose.", 90, 154);
  20. ctx.fillStyle = "black";
  21. ctx.fillRect(50, 180, 20, 20);
  22. ctx.fillStyle = "#111111";
  23. ctx.fillText("hitting one of these will give you points. however, it will make the game faster.", 90, 194);
  24. ctx.fillStyle = "black";
  25. ctx.font = "50px" + font;
  26. ctx.fillText("back", 50, 270);
  27. canvas.addEventListener("mousemove", mousemoveEventOnHelp, false);
  28. canvas.addEventListener("click", mouseclickEventOnHelp, false);
  29. setTimerDrawForHelp();
  30. };
  31.  
  32. var setTimerDrawForHelp = function() {
  33. clearInterval(timerDrawIdForHelp);
  34. timerDrawIdForHelp = setInterval("drawForHelp()", 20);
  35. };
  36.  
  37. var clear = function() {
  38. ctx.fillStyle = "white";
  39. ctx.fillRect(0, 0, canvas.width, canvas.height);
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement