Chapter 8. Building an app
Bringing it All Together
Put on your toolbelt. That is, the toolbelt with all your new coding skills, your knowledge of the DOM, and even some HTML & CSS. Weâre going to bring everything together in this chapter to create our first true web application. No more silly toy games with one battleship and a single row of hiding places. In this chapter weâre building the entire experience: a nice big game board, multiple ships and user input right in the web page. Weâre going to create the page structure for the game with HTML, visually style the game with CSS, and write JavaScript to code the gameâs behavior. Get ready: this is an all out, pedal to the metal development chapter where weâre going to lay down some serious code.
This time, letâs build a REAL Battleship game
Sure, you can feel good because back in Chapter 2 you built a nice little battleship game from scratch, but letâs admit it: that was a bit of a toy gameâit worked, it was playable, but it wasnât exactly the game youâd impress your friends with, or use to raise your first round of venture capital. To really impress, youâll need a visual game board, snazzy battleship graphics, and a way for players to enter their moves right in the game (rather than a generic browser dialog box). Youâll also want to improve the previous version by supporting all three ships.
In other words, ...
Get Head First JavaScript Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.