Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var showHelp = function() {
- clear();
- removeAllListener();
- canvas.style.cursor = "default";
- ctx.fillStyle = "black";
- ctx.font = "100px" + font;
- ctx.fillText("help", 120, 80);
- ctx.font = "12px" + font;
- ctx.textAlign = "left";
- ctx.fillStyle = "black";
- ctx.fillRect(50, 100, 20, 20);
- ctx.fillStyle = "#111111";
- ctx.fillText("this is your square. it is controlled by the mouse.", 90, 114);
- ctx.fillStyle = "red";
- ctx.fillRect(50, 140, 20, 20);
- ctx.fillStyle = "#111111";
- ctx.fillText("this is an enemy. if you hit one of these, you lose.", 90, 154);
- ctx.fillStyle = "black";
- ctx.fillRect(50, 180, 20, 20);
- ctx.fillStyle = "#111111";
- ctx.fillText("hitting one of these will give you points. however, it will make the game faster.", 90, 194);
- ctx.fillStyle = "black";
- ctx.font = "50px" + font;
- ctx.fillText("back", 50, 270);
- canvas.addEventListener("mousemove", mousemoveEventOnHelp, false);
- canvas.addEventListener("click", mouseclickEventOnHelp, false);
- setTimerDrawForHelp();
- };
- var setTimerDrawForHelp = function() {
- clearInterval(timerDrawIdForHelp);
- timerDrawIdForHelp = setInterval("drawForHelp()", 20);
- };
- var clear = function() {
- ctx.fillStyle = "white";
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement