Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
HTML5 Game Development Hotshot

You're reading from   HTML5 Game Development Hotshot Build interactive games with HTML, DOM, and the CreateJS Game library.

Arrow left icon
Product type Paperback
Published in Jul 2014
Publisher
ISBN-13 9781849695466
Length 366 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Makzan Makzan (Mak Seng Hin) Makzan Makzan (Mak Seng Hin)
Author Profile Icon Makzan Makzan (Mak Seng Hin)
Makzan Makzan (Mak Seng Hin)
Seng Hin Mak Seng Hin Mak
Author Profile Icon Seng Hin Mak
Seng Hin Mak
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Building a CSS Quest Game FREE CHAPTER 2. Card Battle! 3. Space Runner 4. Multiply Defense 5. Building an Isometric City Game 6. Space Defenders 7. A Ball-shooting Machine with Physics Engine 8. Creating a Sushi Shop Game with Device Scaling Index

Mission briefing

We are going to create a matching game. This game presents a combination of patterns to the player, and some of these patterns overlap each other. Players analyze the patterns and then select them in the correct sequence so that the composition matches the provided one. You may visit the URL http://makzan.net/html5-games/color-quest/ to play the example game in order to have a better understanding of what we will build throughout this project.

The following screenshot shows the final result of this project. The upper part is a timer, the part to the left shows the quest, the right part is the composition of the player, and the lower part is the deck of patterns.

Mission briefing

Why is it awesome?

A simple matching game like this is a perfect way to get you warmed up with the HTML5 games' development rhythm. What we will learn in this project is the foundation to build more complicated games later in this book.

This game uses what we are familiar with: HTML element interaction and styling in CSS. What's new, is JavaScript logic. This project will show us how to convert the game rule into code. We will also learn how to separate logic into different parts with different responsibilities.

Your Hotshot objectives

We'll perform the following tasks in this project:

  • Creating the HTML structure
  • Managing the game scenes
  • Representing the quest pattern composition
  • Placing the patterns on the deck
  • Selecting the pattern
  • Comparing players and compositions of the quest
  • Showing different quests
  • Counting down the game

Mission checklist

In this game, we are going to stick to plain JavaScript without using a library. This will help us get started with a basic foundation in JavaScript.

Note that writing JavaScript for games is a little bit different from writing it for a web page. Game logic requires well-structured code to ensure the logic is easy to read and maintained. The following essays provide an in-depth discussion on writing JavaScript in the right way:

You have been reading a chapter from
HTML5 Game Development Hotshot
Published in: Jul 2014
Publisher:
ISBN-13: 9781849695466
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image