HTML5 Game Development For Dummies
Published by
John Wiley & Sons, Inc.
111 River Street
Hoboken, NJ 07030-5774
www.wiley.com
Copyright 2013 by John Wiley & Sons, Inc., Hoboken, New Jersey
Published by John Wiley & Sons, Inc., Hoboken, New Jersey
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions .
Trademarks: Wiley, the Wiley logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
For technical support, please visit www.wiley.com/techsupport .
Wiley also publishes its books in a variety of electronic formats and by print-on-demand. Not all content that is available in standard print versions of this book may appear or be packaged in all book formats. If you have purchased a version of this book that did not include media that is referenced by or accompanies a standard print version, you may request this media by visiting http://booksupport.wiley.com . For more information about Wiley products, visit us www.wiley.com .
Library of Congress Control Number: 2013932120
ISBN: 978-1-118-07476-3 (pbk); ISBN: 978-1-118-26144-6 (ebk); ISBN: 978-1-118-22261-4 (ebk); ISBN: 978-1-118-23652-9 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
About the Author
Andy Harris is the author of numerous books on gaming and web development. He taught himself computer programming by building games on the TRS-80 model I, and hasnt stopped playing yet.
Andy taught special education for several years while also working as a contract programmer. Eventually he found himself at Indiana University/Purdue University Indianapolis teaching computer science full time. He currently serves in the computer science department as a senior lecturer, where he is responsible for the freshman computing program. He also teaches game and web development.
Andy is also a regular columnist for a major homeschooling magazine, where he writes about how to use and teach computing at home.
You can learn more about Andy or ask him a question at his website: http://www.aharrisbooks.net
. Visit this site to see every example in this book, and to see what else Andy is doing these days.
Dedication
I dedicate this book first to Jesus Christ my personal savior.
Acknowledgments
First acknowledgment always goes to my amazing wife Heather. I couldnt write books without you, but then I couldnt do much of anything without you. I love you dearly. A big thanks to Elizabeth, Matthew, Jacob, and Benjamin. Now you know what I was doing in the office all that time.
Thank you also to my students, current and in the past. Ive learned much more from you than you ever have from me. A special shout goes to the In-Grace high school group and CSCI N301 classes, for helping me test the projects in this book.
A huge thank you goes to Tyler Mitchell, for his contributions to the simpleGame Engine, especially the animation system. Thank you Tyler, for your incredible contributions. Im looking forward to incorporating your other ideas into a future version of the program.
Thanks to Tom Dunlap for additional testing and support. Without Tom, the game engine might not have some of its key features.
Thanks to Katie Feltman, for years of friendship and support. I appreciate you understanding what I wanted to do with this book and helping to make it happen. Blessings to you in your new endeavors.
Mark Enochs once again plied his magic on this book. Thank you, Mark, for putting so much energy into this project. Youre a good friend and a great partner in this process.
Thank you to my editors Linda Morris, Melba Hopper, and Mark Enochs, and thank you to my tech editor Russ Mullen. Thanks also to the many people at Wiley the author never meets, but who add to the book.
A huge thank you goes to the various open source and creative commons authors that contributed to this project. Look for specific individual attributions in the various projects. A special thank you goes to the folks at open game art, Kreiners tilesets, and Aris sprite lib. I made up for my own lack of art skills by utilizing the talents of these incredible artists, and I truly appreciate their generosity.
The biggest thanks goes to you for reading this book. If youve read any of my other books, thank you so much for your support. If this is your first book with me, welcome aboard! I cant wait to share the fun of game development in HTML5 with you.
Publishers Acknowledgments
Were proud of this book; please send us your comments at http://dummies.custhelp.com . For other comments, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
Some of the people who helped bring this book to market include the following:
Acquisitions and Editorial
Project Editors: Mark Enochs, Linda Morris
Senior Acquisitions Editor: Katie Feltman