| Author |
Use of WebWorkers for gaming - HTML5 Game Programming question
|
andrew ennamorato
Ranch Hand
Joined: Oct 03, 2007
Posts: 100
|
|
Web workers seem like an important addition to Javascript, especially in terms of gaming. Being able to run a 'thread' to calculate say, collision detection, seems valuable. Wondering if you cover web workers in the book at all, or if they are too much a pain to use due to their limitations (no access to DOM, for ex).
|
 |
James Williams
author
Ranch Hand
Joined: Apr 18, 2009
Posts: 35
|
|
Andrew,
Web Workers are covered. Web Workers communicate with the host page via message passing. If you can modularize your code in such a way to separate the computation needed on a worker thread from say the UI drawing, you won't have a problem with not accessing the DOM from the worker.
|
 |
andrew ennamorato
Ranch Hand
Joined: Oct 03, 2007
Posts: 100
|
|
Cool, good to hear. I haven't seen a lot on web workers re: the whole 'HTML5' thing (seems like web sockets, local storage and geolocation get most of the pub) so something to look forward to in the book.
Thanks!
|
 |
 |
|
|
subject: Use of WebWorkers for gaming - HTML5 Game Programming question
|
|
|