Advanced Game Design with HTML5 and JavaScript
How do you make a video game? Advanced Game Design with HTML5 and JavaScript is a down to earth education in how to make video games from scratch, using the powerful HTML5 and JavaScript technologies. This book is a point-by-point round up of all the essential techniques that every game designer nee...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Berkeley, CA :
Apress
2015.
|
Edición: | 1st ed. 2015. |
Colección: | The Expert's Voice in Game Development
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009742734406719 |
Tabla de Contenidos:
- Contents at a Glance; Introduction; Chapter 1: Level Up!; Some New JavaScript Tricks; Variables: let, const, and var; Functions; Getting Loopy with Arrays; Using forEach; Using a for of Loop; Looping through Objects; Looping through Only Some Array Elements; Finding Array Elements; Mapping an Old Array to a New Array; Filtering Elements from an Array; Reducing Array Elements to a Single Value; Making Variables from Arrays with Destructuring; Function Arguments; Initializing a Function with a Configuration Object; Getters and Setters; Preventing Changes to Properties with Object.defineProperty
- Creating ObjectsMaking Objects from Other Objects; Composition; Understanding Closure; Configuring Objects; Mixing and Matching Objects; Classes; Inheritance; Modules; Module Basics; Importing a Property as a Different Name; Module Export and Import Options; Module Default Exports; Re-exporting Modules; Modules and Code Architecture; Working with External Data; Loading Data with JSON and XHR; How XHR Loads the JSON file; Saving Game Data with localStorage; More Options for Loading and Saving Game Data; Using Promises; Playing Games Full- Screen; Using the Fullscreen API
- Creating a Full-Screen Toggle ButtonMinifying Your JS Source Code; Using iFrames to Distribute Your Games on the Web; Setting Focus to the iFrame; Summary; Chapter 2: The Canvas Drawing API; Setting Up the Canvas; Drawing Lines; Line Caps; Connecting Lines to Create Shapes; Drawing Complex Shapes; Line Joins; Drawing Squares and Rectangles; Gradients; Drawing Circles and Arcs; Drawing Curved Lines; Shadows; Rotation; Scale; Making Things Transparent; Using Blend Modes; Compositing Effects; Filling Shapes with Images; Drawing an Image; Masking an Image; Blitting an Image onto the Canvas; Text
- SummaryChapter 3: Working with Game Assets; The assets Object; Building the assets Object; Initializing the Loading Process; Loading Images; Loading Fonts; Loading JSON Files; Using a Texture Atlas; Creating the Texture Atlas; Loading the Texture Atlas; Loading and Using the Texture Atlas in Your Game Code; Summary; Chapter 4: Making Sprites and a Scene Graph; What Are Sprites?; Making a Rectangle Sprite; The children Array; The rectangle Sprite; The render Function; Making Sprites; Building a Scene Graph; Creating Nestable Rectangle Sprites; The Stage and the Canvas; The New render Function
- Nesting SpritesLocal and Global Coordinates; Rotation; Scale; Alpha Transparency; Depth Layering; Sprites for Games; The DisplayObject Class; Coding the DisplayObject Class; A Full-featured Render Function; The Stage; The Rectangle Class; Masking; API Insurance; Pivoting Around the Rotation Axis; The Circle Class; The Line Class; The Text Class; The Group Class; The Sprite Class; Making Sprites from Single Images; Making Sprites from Texture Atlas Frames; Blitting a Subimage from a Tileset; Blitting Multiple Tileset Frames; Using Multiple Texture Atlas Frames; Using Multiple Image Files
- Making Your Own Sprites