Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Book: Professional HTML5 Mobile Game Developmen
This is the forum to discuss the Wrox book Professional HTML5 Mobile Game Development by Pascal Rettig; ISBN: 978-1-118-30132-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Book: Professional HTML5 Mobile Game Developmen section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 14th, 2013, 06:59 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Exclamation Error in Alien Invasion Code

Am I the only one having bought this book?

The game 'Alien Invasion' presented in the first chapter contains an error.
In engine.js this.setupInput adds two event handlers.

In both handlers the event parameter is named 'e', although it is referenced as 'event' in both function bodies. Renaming all those references to 'e' solves all problems.


The error is present in the downloadable source too!
This is why almost all example sources of the first three chapters wont work, since you can't start the game.
The Following User Says Thank You to bubumann For This Useful Post:
sauerkraut (May 11th, 2013)
  #2 (permalink)  
Old February 16th, 2013, 11:50 AM
Wrox Author
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

Good catch - unfortunately with the typo the code continued to work in Chrome and IE (but not Firefox) as they set a global window.event property.

But yes, the "event" variable should be switched to the parameter "e"


Similar Threads
Thread Thread Starter Forum Replies Last Post
error in code! sabra BOOK: Beginning SQL 2 June 19th, 2010 03:45 AM
Code error reverand Excel VBA 1 November 15th, 2006 02:08 AM
Error in the example code FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 October 27th, 2005 06:22 AM
Code error!?!? Brian Campbell BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 November 26th, 2004 07:47 PM
Error displayed with error trap code stoneman Access 4 February 28th, 2004 02:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.