Foundation game design with HTML5 and JavaScript
Foundation Game Design with HTML5 and JavaScript teaches you everything you need to know about how to make video games. If you’ve never done any programming before and don’t know where to start, this book will show you how to make games from start to finish. You’ll learn all the latest programming t...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
[Berkeley, Calif.] :
Friends of ED
c2012.
|
Edición: | 1st ed. 2012. |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009629378506719 |
Tabla de Contenidos:
- Title Page; Copyright Page; Contents at a Glance; Table of Contents; About the Author; About the Technical Reviewer; About the Cover Image Artist; Acknowledgments; Introduction; Chapter 1 Learning HTML and CSS; What you need; A computer; Programming software; Graphic design software (optional); What kinds of games can I make?; How hard is it?; Learning HTML; Tags; Structuring HTML documents; A basic web page; Using an attribute to set the document language; Adding a page title; Page headings; Paragraph text; Italic and bold text; Making lists; Adding links
- Linking to something on the same pagePrefetching pages; Adding images; Making comments; Character encoding; More about HTML; Make it prettier with CSS; Font styles; Font family; Embedding custom fonts; Font sizes; Font colors; More about colors; Bold, italic, and underline font styles; List styles; Highlighting links; Borders, padding, height, and width; Cascading styles; Using elements; Using an id; Using a class; Using an id and class together; Loading background images into HTML elements; Positioning elements with CSS; Inline and block elements; Floating elements
- Adding margins to space the elementsClearing floating elements; More about centering elements; Absolute positioning; More about block sizes: The box model; Organizing your files; Separating HTML and CSS code; Organizing code and media; More about the video and audio elements; Learning more about HTML and CSS; Summary; Chapter 2 Learning JavaScript; Setting up; Displaying messages in the console; What should you do if your program doesn't work?; Variables; Working with numbers; Working with strings; Working with true or false variables; Decision making; Checking more conditions
- Using a switch statementUsing && and ||; Using functions; Functions with multiple arguments; The calculator function; Functions that return values; Function expressions; Controlling HTML and CSS; Creating new text in an HTML element; Changing CSS with JavaScript; Creating and removing HTML elements; Removing HTML elements; Clicking on buttons; Removing an event listener; Counting; Detecting keyboard key presses; Entering and displaying text; Other cursor properties; Organizing your JavaScript code; Linking the JavaScript program to the HTML document; Using the program.js file
- A quick guide to debugging codeSummary; Chapter 3 Your First Games; A basic number-guessing game; Initializing variables; Using functions to modularize the program; Forcing strings to become numbers; A little more about parseInt; Displaying the game state; Counting guesses; Tying up strings; Winning and losing; If statements and Boolean variables; HTML code within strings; Modular programming with functions; Polishing up; Allowing only numbers to be entered; Using the Enter key to input numbers; Improving the user interface; Adding focus to the input field
- Disabling the input field, button, and the Enter key