Build an HTML5 game : a developer's guide with CSS and JavaScript /
This book will show you how to create a truly cross-platform bubble-shooter game--playable in both desktop and mobile browsers. Readers will learn how to: send sprites zooming around the screen with JavaScript animations; make things explode with a jQuery plug-in; use hitboxes and geometry to detect...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
San Francisco :
No Starch Press,
[2015]
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- About the Author; Brief Contents ; Contents in Detail ; Preface; Acknowledgments; Introduction; Why Build HTML5 Games?; Using Skills You Already Have; Multi-environment Development; A Rapidly Improving Platform; About This Book; Who This Book Is For; Overview; Depth of Coverage; How to Use This Book; Part 1: Building a Game with HTML, CSS, and JavaScript; Chapter 1: Preparation and Setup ; How the Game Is Played; Building the Game; Development and Testing Environment; Web Browser Testing; Debugging in the Web Browser; Laying Out the Game Screen; Creating Panels with HTML and CSS.
- Code StructureAdding the First Scripts; The Modernizr and jQuery Libraries; Adding the Modernizr Library; Loading in Scripts with Modernizr; Modular JavaScript; User Interface and Display Scripts; Summary ; Further Practice; Chapter 2: Sprite Animation Using jQuery and CSS; Principles of CSS Sprites; Creating the Game Board ; Adding Sprites; Animation and the Bubble Class; Calculating Angle and Direction; Firing and Animating Bubbles; Summary; Further Practice; Chapter 3: Game Logic; Drawing the Game Board; Rendering the Level; The Bubble Queue; Detecting Collisions; Collision Geometry.
- Collision Detection LogicReacting to Collisions; Adding the Bubble to the Board; Locking the Bubble into the Grid; Summary; Further Practice; Chapter 4: Translating Game State Changes to the Display; Calculating Groups; Fetching Bubbles; Creating Matching Color Groups; Popping Bubbles; Removing Bubble Groups with JavaScript; Popping Animations with CSS; Orphaned Groups; Identifying Orphaned Bubbles; Dropping Orphaned Bubbles; Exploding Bubbles with a jQuery Plug-in; Summary; Further Practice; Part 2: Enhancements with HTML5 and the Canvas; Chapter 5: CSS Transitions and Transformations.
- Benefits of CSSBasic CSS Transitions; How to Write a Transition; Color-Changing Buttons; Basic CSS Transformations; How to Write a Transformation; Scaling a Button; CSS Transitions in Place of jQuery animate; Disadvantages of CSS Transitions; Summary; Further Practice; Chapter 6: Rendering Canvas Sprites; Detecting Canvas Support; Drawing to the Canvas; Image Rendering; Canvas Elements; Rotating a Canvas; Sprite Rendering; Defining and Maintaining States ; Preparing the State Machine; Implementing States; Sprite Sheets and the Canvas; The Canvas Renderer; Moving Sprites on the Canvas.
- Animating Canvas Sprite FramesSummary; Further Practice; Chapter 7: Levels, Sound, and More; Multiple Levels and High Scores; New Game State Variables; Display Level and Score; Ending Levels Efficiently; High Score Persistence with Web Storage; Web Storage vs. Cookies; Adding Data to Web Storage; Smoothing Animations with requestAnimationFrame; A New Perspective on Frame Updates; Code Compatibility with Polyfills; Adding Sound with HTML5 ; The HTML5 Audio API; Popping Bubbles: Complete with Sound; Summary; Further Practice; Chapter 8: Next Steps in HTML5; Saving and Retrieving Data; AJAX.