HTML and CSS Reference
In-Depth Information
});
$("#hide-top-ten").on("click",function() {
$("#show-top-ten, #blob").show();
$("#hide-top-ten, #top-ten").hide();
});
window.scrollTo(0,10);
$("html").on("touchmove",function(e) { e.preventDefault(); });
});
</script>
</body>
</html>
For conciseness, this 80-line file contains all the pieces of the client side of the game (except the styles). A
larger game would be broken into multiple separate JS files, as you've seen previously.
The file first sets up a number of HTML elements that contain the visual pieces of the game. Again, if you
have the styles and images loaded in, you get something nicer looking; otherwise, you just see text. Figure 20-5
shows the final game in action.
Figure 20-5: The final Blob Clicker game.
 
 
Search WWH ::




Custom Search