Hacker News new | ask | show | jobs
by madoublet 4680 days ago
Is the game built in WinJS? Do you re-use the same code for both the game and the site?
1 comments

Yes, the Windows 8 game is built using WinJS. However - and unfortunately - WinJS doesn't work on the web since it tries to call WinRT APIs which it doesn't have permission to use. Microsoft doesn't provide a subset of WinJS which works on the web so I essentially had to rip out all the WinJS code to make it work on my site. That meant I lost things like saved games and high scores since I used WinJS data binding to implement them. I also couldn't integrate with the Windows 8 charms from the web so I had to get rid of that stuff as well. But other than the UI and page navigation, the rest of the code is exactly the same on the app and the web.

I'm working on removing WinJS from the Windows 8 app since I only use it in a couple places where I can roll my own solution. If I accomplish that, I should be able to simply copy the same files onto my server and have it work on every browser. That would be pretty cool!

Very cool. I built a simple Windows 8 app, but rolled most of my own JS solutions b/c of a lot of the same reasons you had.