Apple approves JavaScript iOS games that don't use a browser

Look Ma, no WebKit! Your inner geek and nerd should give each other a little hug this morning as you read about the latest rather cool accomplishment of Dominic Szablewski, creator of the Impact JavaScript HTML 5 game engine.
He's just released two free games, Biolab Disaster and Drop, which are not, as Szablewski says, the first JavaScript games to be released in the App Store. "Tools like PhoneGap or Titanium make it easy to bundle some HTML pages and JavaScript together in an app and display them in a UIWebView, which is basically just a browser window," he says.
However, his games are different because they don't use a browser window to display them.
"They don't use PhoneGap or Titanium. They don't even use a UIWebView. Instead, they bypass the iPhone's browser altogether and use Apple's JavaScript interpreter (JavaScriptCore) directly. All graphics are rendered with OpenGL instead of in a browser window and all sound and music is played back with OpenAL," Szablewski says.
What Szablewski has done wasn't particularly easy, and as games, his offerings aren't up there with Angry Birds. But his work could open the way for other developers to write more apps with a minimum of fuss. Read his blog for full details of the process.
Share
Look Ma, no WebKit! Your inner geek and nerd should give each other a little hug this morning as you read about the latest rather cool...
Add a Comment
It's worth noting that Titanium does not bundle HTML and js. Js is compiled to Obj-C.
May 01 2011 at 2:23 PM Report abuse Permalink rate up rate down ReplyLua doesn't have a normal class system.
You can create a class sytem (or a prototype system by the way) but nothing is forced.
Actually I guess they are not using private API. They have bundled a different version of JavascriptCore from WebKit with the game. They are not using Nitro because it isn't compatible with the security restrictions of the device.
More here:
http://www.phoboslab.org/log/2011/04/ios-and-javascript-for-real-this-time
I still think Lua is better for this sort of thing. Pretty similar to Javascript. At least with out Nitro, Lua should be faster and lighter.
I checked out Lua once to try to do some WoW addons but damn if it wasn't confusing. I didn't give it all that long, mind you, just saying the syntax was ... unique.
April 29 2011 at 6:01 AM Report abuse Permalink rate up rate down ReplyPersonally I think Javascript is the odd language with a pure prototype-based class system. Lua has a normal class system and 1st party support for closures and coroutines (and support for prototypes). I'm surprised it isn't more popular with Ruby devs for this reason.
April 29 2011 at 10:35 AM Report abuse Permalink rate up rate down ReplyJavascriptCore is currently private API. If Apple decides they care this may be pulled. They have been letting scripting languages in though. Lua may be a better choice for this sort of thing.
April 29 2011 at 2:06 AM Report abuse Permalink rate up rate down ReplyI learned Objective-C and have an iPad game on the App Store, and believe me, this lightweight little JavaScript engine is more impressive than Cocos2D or any of the game engines out there that I've spent time with. It even does Box2D physics. It shows just how powerful cross-platform JS can be. The way the engine is built means you don't miss more advanced things like calling super that you get with lower-level languages. Even people who know C languages often use Python or other scripting languages for rapid prototyping. (just try to generate a String in C and you'll remember why people like scripting languages). This game engine changed my opinion of JavaScript. Just look at the results in Biolab Disaster.
April 28 2011 at 3:10 PM Report abuse Permalink rate up rate down ReplyNeat little game, that Biolab one. I actually still have it in the bottom right corner of my 'Top Sites' grid. I'll have to futz with it on my touch since it is free after all. Onscreen button interfaces, this is your last chance to win me over! You hear me?
April 28 2011 at 9:30 AM Report abuse Permalink rate up rate down ReplyThe lengths people will go to avoid learning a new programming language...
April 28 2011 at 9:23 AM Report abuse Permalink rate up rate down Replyor become AWESOME at the ones they already know!
April 28 2011 at 11:44 AM Report abuse Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- Used Apple iPhone 3G 8GB for AT&T for $108 + $5 s&h
- Apple Mac Pro Xeon 6-Core 3.3GHz Desktop w/ 12GB RAM for $3,899 + $28 s&h
- Apple MacBook Pro Core i7 Quad 2.2GHz 15" SSD Laptop for $2,447 + $13 s&h
- Apple Earphones with Remote and Mic for $6 + $2 s&h
- PC Micro Store sale: Up to 50 off
- USB MP3 Player FM Transmitter with remote for $6 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



10 Comments