News for hackers. Stuff that matters.
Re:Impact JavaScript Game Engine for iOS by teamonkey on Monday October 11, 2010 @10:41AM (#1779848)
It is a native app: it uses JavaScriptCore and all Canvas calls are rendered using OpenGL. The implications are that if you write a game for Impact engine you can generate an iOS native app.
Re:Impact JavaScript Game Engine for iOS by revjx on Monday October 11, 2010 @10:45AM (#1779863)
It's not quite that simple, though, from the sound of it - the author said he had to 'reimplement' all the canvas calls to use OGL. Fine if you're familiar with it, but for those people who just want to bash out a Javascript game without having to worry about the engine, they might have trouble.
Re:Impact JavaScript Game Engine for iOS by phoboslab on Monday October 11, 2010 @11:05AM (#1779929)
So far I only reimplemented those Canvas API functions needed for the game; the most important one being .drawImage().

What I mean by "reimplement", is providing a .drawImage function for JavaScript that works in the same way as it does in the browser, but uses OpenGL-ES behind the scenes. This reimplementation is done in native Objective C.

The changes I had to make to Impact (the "HTML5" engine) are concerned with the loading of images, scaling, input and getting a reference to the canvas element and its drawing context. But I guess I could provide a dummy "document" and "getElementById" function, so that you can just write some JavaScript using Canvas and run it in the browser and on the iPhone unchanged.

Note that this whole idea isn't exactly new: http://www.youtube.com/watch?v=0UN2iYrZmEY

Re:Impact JavaScript Game Engine for iOS by pirko on Monday October 11, 2010 @10:50AM (#1779885)
From what I understand he only had to re-implement the canvas calls in the game engine. "I of course had to make some changes to the engine, but the game source code is exactly the same as for the web version."
Re:Impact JavaScript Game Engine for iOS by st3fan on Monday October 11, 2010 @12:13PM (#1780135)
See my comment about not being able to use compiled/jitted javascript from apps because of code execution restrictions set by iOS.