Create a real 2D game from start to finish with ImpactJS, the JavaScript game framework that works with the HTML5's Canvas element. Making video games is hard work that requires technical skills, a lot of planning, and—most critically—a commitment to completing the project. With this hands-on guide, you’ll learn how to use Impact with other technologies step-by-step.You’ll pick up important tips about game design, and discover how to publish Impact games to the Web, desktop, and mobile—including a method to package your game as a native iOS app. Packed with screen shots and sample code, this book is ideal for game developers of all levels.Set up your development environment and discover Impact’s advantagesBuild a complete game with core logic, collision detection, and player and monster behaviorLearn why a game design document is critical before you start buildingDisplay and animate game artwork with sprite sheetsAdd sound effects, background music, and textCreate screens to display stats and in-game statusPrepare to publish by baking your game files into a single file Cover 1 Table of Contents 7 Preface 11 About This Book 11 Who This Book Is For 11 Who This Book Is Not For 12 Conventions Used in This Book 12 This Book’s Example Files 12 Using Code Examples 13 How To Use This Book 13 Safari® Books Online 13 How to Contact Us 14 Acknowledgments 14 Chapter 1. Introduction To Impact 15 Why Use Impact? 15 Setting Up a Local Environment 16 Install WebStorm/PHPStorm 16 Install Apache/PHP/MySQL 17 Other Hosting Options 17 Setting Up a New Impact Project 18 Modules 20 How Classes Work 21 Core Classes 22 How Inner Classes Work 24 Level Editor 25 Chapter 2. Working With Sprites 27 Sprites and Sprite Sheets 27 Scripting in Photoshop 28 Working with Sprites in Photoshop 30 Optimizing Sprites 31 Chapter 3. Introduction To Game Design 33 What is Game Design? 33 Sample Game Design Document 35 Gameplay 35 Exploring a Map 35 Combat 36 Completing a Map 36 Death 36 Main Character 36 Monsters 36 Bosses 37 Equipment 37 Inventory 37 Equipping Items 38 Weapons and Armor 38 Leveling Up 39 Winning the Game 39 Coming Up With Ideas 39 Books to Read 40 Chapter 4. Building A Game 41 Creating Our First Level 42 Saving/Loading Maps in Weltmeister 45 CollisionMaps 46 The Main Class 47 Customizing the Main Class 49 Key Binding 49 Creating the Player Class 50 Using Your Sprite Sheet 51 Adding Simple Physics 52 Defining Animation Sequences 52 Creating a Monster Class 55 Collision Detection 58 type Property 59 checkAgainst Property 59 collides Property 59 Health 61 Weapons 62 Firing the Weapon 63 Add Multiple Weapons 64 Killing Entities 68 Respawning the Player 69 Create Death Animations 71 Adding Grenade Explosions 75 Customizing the Camera 76 Loading New Levels 78 Chapter 5. Working With Text 83 Creating Font Sprite Sheets 83 Adding Text to Your Game 84 Chapter 6. Working With Sound 87 Adding Sounds 87 Adding Music 88 Mobile Browser Sound Compatibility Issues 89 Chapter 7. Creating Game Screens and HUDs 91 Extending Impact’s Game Class 91 Creating a Start Screen 92 Player Stats Screen 94 Creating the Game Over Screen 98 Adding In-Game HUD 100 Game Rewards 101 In-Game Analytics 102 Chapter 8. Debugging Your Game 107 Impact’s Debugger 107 Publishing Your Game 110 Baking Your Game 110 Mobile Web Support 111 Compiling for Native iOS 112 Chapter 9. Wrapping Up 117 References and Links 118 Create a real 2D game from start to finish with ImpactJS, the JavaScript game framework that works with the HTML5's Canvas element. Making video games is hard work that requires technical skills, a lot of planning, and{u2014}most critically{u2014}a commitment to completing the project. With this hands-on guide, you{u2019}ll learn how to use Impact with other technologies step-by-step. You{u2019}ll pick up important tips about game design, and discover how to publish Impact games to the Web, desktop, and mobile{u2014}including a method to package your game as a native iOS app. Packed with screen shots and sample code, this book is ideal for game developers of all levels. Set up your development environment and discover Impact{u2019}s advantages Build a complete game with core logic, collision detection, and player and monster behavior Learn why a game design document is critical before you start building Display and animate game artwork with sprite sheets Add sound effects, background music, and text Create screens to display stats and in-game status Prepare to publish by baking your game files into a single file Flash is one of the best platforms for developing games on. Whether you want to deploy it to web, desktop or mobile Flash offers one of the largest user bases around. Step-by-step guide to creating a 2D game using Impact, the JavaScript game framework that works with HTML5's Canvas element