Chapter 2

Talking to the User

In This Chapter

arrow Building a page with form elements

arrow Using CSS for better forms

arrow Introducing JavaScript

arrow Responding to button clicks

arrow Changing CSS elements

Although HTML and CSS are pretty cool as they are, games are really about interactivity. You can get a small amount of interactivity through hyperlinks, but for the really fun stuff, you need to write computer code.

Most people think that computer programming is a challenging skill, but it’s actually not that hard to learn. You already have everything you need to get started: a text editor and a basic web page.

Modern web browsers all have built-in support for a programming language called JavaScript. JavaScript is a reasonably easy language to learn, and it provides more than enough power for some really fun games. Here are a few key features of JavaScript:

check.png It’s a scripting language. This class of programming ...

Get HTML5 Game Development For Dummies 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.