Book Image

HTML5 Game Development with ImpactJS

By : Davy Cielen, Arno Meysman
Book Image

HTML5 Game Development with ImpactJS

By: Davy Cielen, Arno Meysman

Overview of this book

<p>ImpactJS is a JavaScript library specially geared towards building 2-dimensional games. It is intuitive and versatile and allows the game developer to get results in no time while keeping an easy overview when games grow more complex. Games built with ImpactJS can be published on websites and even as an app on both Android and iOS. <br /><br />With "HTML5 Game Development with ImpactJS", building games for the Web and app markets has never been so easy. Using the ImpactJS JavaScript engine, you only need this book and basic knowledge of JavaScript in order to build and publish your own game. <br /><br />"HTML5 Game Development with ImpactJS" allows a single person to build a full game. Using only basic knowledge of JavaScript and this book, you will end up publishing a 2D game for the entire world to enjoy. You will learn to set up a working environment and gather all the necessary tools and resources your game needs. Develop both a top-down and a side scroller game, integrate physics such as gravity, and deploy your game as an app or to your website.</p>
Table of Contents (17 chapters)
HTML5 Game Development with ImpactJS
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Building an RPG level


Now it is time to put our own little RPG together. We will start our journey with a clean slate. Following are the steps to build an RPG level:

  1. Let's take a copy of the freshly installed ImpactJS folder that we kept in the chapter 1 folder and rename it to RPG. Copy the media folder from the chapter 3 folder to your RPG/media folder. This way at least we have some graphics to work with.

  2. Go back to the it works! screen you get when you enter localhost/RPG in your browser.

  3. Let's start by opening the Weltmeister (localhost/Weltmeister.html) and drawing a small level.

  4. You will notice that there is nothing prepared for you this time around. The only available layer is the entities layer and it doesn't even contain a single entity. However, we can draw ourselves a small playing field to get started once we have something to populate the world.

  5. So let's add another layer (+-sign) and call it grass. Let's set the tile size to 16 and have a 30 x 20 zone at a distance of 1 pixel....