Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 14th, 2013, 05: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, 10: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"
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01: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 06:47 PM
Error displayed with error trap code stoneman Access 4 February 28th, 2004 01:53 PM



All times are GMT -4. The time now is 12:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.