Your experts today are @seb_ly, @IsogenicEngine, @phoboslab, @andreasrosdal, @evilpies, @michalbe, @BenoitJacob, and @robhawkes.
Date: 29.07.2011. Hashtag: #askmdn.

Q @MuseHill: For Javascript games, is there any practical benefit in using window.crypto when available in place of Math.random()?

A @evilpies: Math.random is not cryptographic secure, you should only use Math.random for speed and _not_ security bugzil.la/440046

Q @user24: Flash is successful for 2 reasons: 1) it does things browsers can't natively. 2) it's embeddable. html5(etc) fixes #1, how about #2?

A @phoboslab: 2.) Most video sites (youtube, vimeo...) now use an iframe to let you embed their videos. The same would work for games.

A @BenoitJacob: New "HTML5" stuff like WebGL address part of that, and more is coming. Note that only Flash 11 gets an answer to WebGL.

Q @josscrowcroft: How is the accelerometer accessed from JavaScript and what are the current capabilities?

A @michalbe: It uses 'deviceorientation' event (or 'mozOrientation' in Fx) and x,y&z coords of tilt. Sample: t.co/qcEcFSP

Q @relequestual: I want to use HTML5 canvas for my final year project (which will probably be some kind of game), however am still rather new to using it. Can you point me towards a good series of tutorials to help get me started. I see many good individual tutorials but not so many series of tutorials. Thanks =]

A @IsogenicEngine: The Mozilla tutorials mzl.la/oMNiIO are good and there are some books on the subject too amzn.to/o4CkhQ

Q @passcod: Best way to handle a resizable <canvas> and⁄or a full page <canvas> in a resizable window? re: mouse events in particular

A @IsogenicEngine: Setup a co-ordinate system right from the start and reset it every time the window resizes. Follow up with me if you want..

Q @kottkrig: what tools are you guys using? IDE? Text editor? Drawing tools?

A @seb_ly: I use TextMate with JavaScript Tools bundle. Hard to work with big libs like Three.js though. Maybe look into WebStorms. and I'm a new big fan of pixelmator - cheap, great UX and like photoshop without all the crap you never needed :)

A @evilpies: I use Vim and Geany.

A @IsogenicEngine: Dreamweaver & Notepad++ and Photoshop & GIMP depending upon the OS. Filezilla for FTP & SFTP also #dropbox for auto-sync

A @andreasrosdal: vim and gimp are great open source tools.

Q @MuseHill: Draw a PNG onto a canvas then getImageData(): I'm finding the resulting RGBA values vary among browsers. Is that to be expected?

A @phoboslab: RGBA values "should" be the same everywhere. However, hardware acceleration can still cause problems: bit.ly/pEVkIi

Q @nannerb: With more loopholes in HTML5 than Flash. Will there be enough future solutions to make things more secure and stop cheating

A @seb_ly: Any client side tech is hackable - making important decisions on the server rather than client is the only solution. and that goes for Flash too. Every Flash game I ever made has had hacked high scores. Despite my best efforts :)

A @IsogenicEngine: Anti-cheat is always going to be a problem if you rely solely on client-side. Keep all your logic server-side and check it!

A @phoboslab: It's true that the hurdle for cheaters is a bit lower with JS, but you can always enforce the game logic server side. Somewhat related, with a deterministic game that runs on all clients, cheaters have no chance: bit.ly/q97ANr

A @andreasrosdal: HTML5 is just as secure as Flash.

Q @ChadBoyer: given that HTML5 engines are sprouting like pixelated weeds. Do you think there will be a consolidation of them soon?

A @seb_ly: I'm always shocked at how quickly JSers reach for the nearest lib. I always advise learning for yourself first. But I'm sure we'll see some libs float to the surface and trends will come and go.

A @IsogenicEngine: More engines = more choice and better competition to achieve excellent results. The market is better for it IMHO. So to answer I doubt there will be consolidation but we'll all be better of for it.

Q @programmingart: What happens when Microsoft indeed does not support WebGL? Imo, One of the biggest advantages for HTML5 is cross plaftorm

A @phoboslab: IE will become even less relevant or they will have "web-d3d" and a library like threejs will make both compatible.

A @seb_ly: I wasn't expecting MS Canvas support. Maybe browser competition will pressure them into supporting webGL too?

A @BenoitJacob: Microsoft already rejected WebGL citing security. But SL5 3D API has similar features and vulns! bit.ly/nY8fjx

A @andreasrosdal: If IE will not support WebGL, then you can always use Google Chrome Frame or http://code.google.com/p/jebgl/

Q @McFunkypants: HTML5 Question: what's a good way to make everything-in-one-file GAMES (for viral game portal distro) like we can w⁄Flash? DataUrls?

A @IsogenicEngine: You can consolidate any JS scripts into one file server-side to deliver single deployment of code but assets are probably better off being single files (as few as possible) so that CDNs can deliver them efficiently. but apparently Mozilla and Google are both working on single deployment.

Q @phuunet: HTML5 audio, canvas, DOM & SVG performance aside, what are the main obstacles when creating a game in Javascript?

A @phoboslab: Nnot much actually. Developing games for HTML5 is a really nice experience. Way more fun than native iOS or Windows, imho

Q @francoislaberge: The FullScreen API Proposal only allows fullscreen via User Input. Why not ask permission like with Storage⁄Location?

A @evilpies: These kind of considerations are being made by mozilla see t.co/nho0VvC

A @seb_ly: Many ways to do that but not easy right now. I expect we'll see some tools appear that faciliate that soon.