Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Use of WebWorkers for gaming - HTML5 Game Programming question

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).

 
author
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic