Making Your First HTML5 Game with Phaser

Retired

This book is no longer available for sale.

Making Your First HTML5 Game with Phaser

Language: JavaScript

About the Book

Learn game development by making a game. Simple as that! Each section teaches a specific and important building block of HTML5 Game Development. This book is perfect for game development beginners looking to learn the basics of game design & development, specifically browser-based HTML5 games. Want to learn how to create your own computer games but don't know where to start? Well you're in the right place, this is the book you need in your life!

About the Author

David Kivlehan
David Kivlehan

Software Developer and founder of bootstrapped software design & development company HoverCraft.ie. My main gig is creating modern and responsive web sites for our clients. There are way too many crummy websites out there at the minute, especially when it comes to mobile browsing. This makes me sad :'( That's why I dedicate an unhealthy amount of time crafting and perfecting sites that look great on every type of device, of all shapes and sizes.When I'm not doing that I work on developing our own suite of products including web apps that we can be proud of.I don't have time to do a heck of a lot else at the minute, it's literally a full time job running your own company!Specialities: HTML, CSS/SASS, ASP.NET MVC, AngularJS, Mobile First & Content First Responsive Web Design

Table of Contents

  • Introduction
    • Who is this book aimed at?
    • What kind of game will we make?
    • HTML5 Games?
    • Do I need to be a JavaScript Expert?
    • Code Conventions Used in Book
  • 0 Setting Up Your Environment
    • 0.1 We need a Web Server, right?
    • 0.2 File And Directory Structure
    • 0.3 Setting up your project in Visual Studio
      • 0.3.1 Getting Setup Using the Phaser Project Template in Visual Studio 2015
      • 0.3.2 Adding Phaser Engine Files Manually
      • 0.3.3 Adding Phaser Engine Files inside Visual Studio Automatically
    • 0.4 Getting Set Up Using the Phaser Project Template in a non-Visual Studio IDE
      • 0.4.1 Download the Project Files Manually
      • 0.4.2 Download the Phaser Files Manually or Using Package Manager
    • 0.5 Overview of the Starter Code
    • 0.6 Set Game as Initial State
  • 1 Tilemaps
    • 1.1 Creating a Tilemap
      • 1.1.1 Tiled Map Editor
      • 1.1.2 Getting A Tileset
    • 1.2 Creating Tilemap in Tiled
    • 1.3 Adding Tilemap to our Phaser Game
      • 1.3.1 Adding A Background Image
      • 1.3.2 Enabling JSON in Visual Studio 2013
  • 2 Sprites
    • 2.1 Adding A Sprite
    • 2.2 Animating A Sprite
    • 2.3 Moving A Sprite
  • 3 Collisions
    • 3.1 Collision Between Sprite And Tilemap
    • 3.2 Adding an Enemy
    • 3.3 Adding Enemy Collision
      • 3.3.1 Collisions with Tilemap
      • 3.3.2 Collisions with Player Sprite
    • 3.4 Making Enemy Move (On Platforms)
    • 3.5 Collecting Treasure
    • 3.6 Exiting the Level
  • 4 The Next Level
    • 4.1 Adding Lives
    • 4.2 Adding Sounds
    • 4.3 Game Over
    • 4.4 Menu Screen
      • 4.4.1 Game States
    • 4.5 Level 2
  • 5 Menu Screens
    • 5.1 Loading Screen
    • 5.2 The Main Menu
    • 5.3 Game Over
  • 6 Prefabs
    • 6.1 What are Prefabs?
    • 6.2 The Player Prefab
    • 6.3 Refactoring Player and Level 1
    • 6.4 Adding More Player Code into the Prefab
    • 6.5 Player Updates
  • 7 Conclusion
  • 8 Bonus Content: Raycasting
    • 8.1 An Idea for Level 2
    • 8.2 What is Raycasting
    • 8.3 Changing enemy Behaviour with Raycasting
  • Appendix

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub