Book Image

HTML5 Game Development by Example: Beginner's Guide

By : Seng Hin Mak
Book Image

HTML5 Game Development by Example: Beginner's Guide

By: Seng Hin Mak

Overview of this book

Table of Contents (18 chapters)
HTML5 Game Development by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
9
Building a Physics Car Game with Box2D and Canvas
Index

Saving objects in the local storage


Now, imagine that we are saving not only the score, but also the date and time when the ranking is created. We can either save two separate keys for the score and date time of playing, or pack the two values into one object and store it in the local storage.

We will pack all the game data into one object and store it.