Blog Home

Impact for iOS

I know you're waiting for the release of the Impact Game Engine, and I promise you, it's coming. I just get distracted too easily. So here's my game Biolab Disaster running on the iPhone 3GS with 60 frames per second:

The game is running in its own process and is not using the iPhone's browser at all. Instead, it's just using the JavaScriptCore Framework to run the game. All the necessary calls to the Canvas API have been reimplemented with OpenGL-ES and the touch input is passed over to JavaScript to be evaluated by the 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.

The JavaScriptCore Framework is still private on iOS. So as it is now, I won't be allowed to distribute the game in the AppStore. But my understanding is, that if I bundle my own copy of the JavaScriptCore Framework (which is part of WebKit and thus freely available) with my game, I should be on the safe side. Let's see how this works out.

Monday, October 11th 2010
— Dominic Szablewski, @phoboslab


#1 – anxious coder – Monday, October 11th 2010, 16:05

i would love to contribute to this project. i'm hoping i see both the browser + ios versions on github soon so i can lend a hand :)

#2Björn Nilsson – Monday, October 11th 2010, 16:14

Im very impressed by this! Are you planning to release this xcode project as opensource later?

As good as I find the performance of the canvas element on iOS, atleast for the way I use it in Orbium, higher framerate wouldnt hurt :-).

Good luck with the app store approval process.

#3 – Daniel – Monday, October 11th 2010, 16:20

I'm so stoked to get my hands on this.

#4Matt – Monday, October 11th 2010, 17:08


Do you have release date planned?

#5Dominic – Monday, October 11th 2010, 17:12

I don't have a release date yet. I probably should set one, because I work faster with a deadline approaching... Anyway, I finished university last week, so I've got some more time on my hands now!

#6Ryan Poolos – Monday, October 11th 2010, 17:26

That is absolutely awesome!

#7Stefan Arentz – Monday, October 11th 2010, 18:11

"The JavaScriptCore Framework is still private on iOS. So as it is now, I won't be allowed to distribute the game in the AppStore. But my understanding is, that if I bundle my own copy of the JavaScriptCore Framework (which is part of WebKit and thus freely available) with my game, I should be on the safe side."

This is true. You can compile Javascript Core and include it in your app. I have done this previously as an experiment.

However, there is one HUGE drawback in doing so: no compiled/jitted javascript code is possible.

This is because iOS applications are not allowed to create executable code in the heap or on the stack, so there is no way to JavaScriptCore to compile to native code when it is running as part of a third party application.

So unfortunately there is no good way to get this going at the same speed that you get when linking against the private framework.

Sad. This is also a major problem for other scripting languages. They all can only run in interpreted mode. Which might be good enough but is never the best you can get.

#8Rob Lord – Monday, October 11th 2010, 18:24


#9 – Tom Fairfield – Monday, October 11th 2010, 18:50

Yep, I hit this roadblock too. For my similar project I ended up using a non-jit version of Spidermonkey for embedded Javascript.
Interpreted performance is pretty poor in comparison to jit though, and I ended up moving to a much higher level Javascript API to share between canvas and native implementations. It runs at 60 fps on 2nd gen hardware now with moderate (1 - 2 hundred sprites).

#10 – Paul Prescod – Monday, October 11th 2010, 20:03

What frame rate did you get with canvas/webkit on iDevices? Presumably it was not good enough.

#11 – Nils – Monday, October 11th 2010, 20:32

Nicely done.. why not reimplement it in C or C++? How much work would it be?

#12Bryant Smith – Monday, October 11th 2010, 20:45

Looks fantastic, I've used JS for quite awhile, so a game engine like this would be really cool for me. Keep up the great work, looks awesome.

#13andy – Monday, October 11th 2010, 21:36

im really glad you're releasing the engine. that is a +100 in my book.

my question is, will this run as an html5 app? accessible by browsers?

#14 – Erik – Monday, October 11th 2010, 21:38

I'm also interested in the framerate when running in the browser on iOS devices.

#15Dominic – Monday, October 11th 2010, 21:40

It runs with about 10 FPS in the browser on an iPhone 3GS; a little faster on an iPad. See my previous post for a performance comparison on different platforms:

#16josh marinacci – Monday, October 11th 2010, 21:41

This looks awesome. How much of your canvas impl is in C vs Objective C? I'd love to port this to webOS which has both a C based OpenGL ES stack and a JavaScript engine.

#17jonbro – Monday, October 11th 2010, 21:48

this is sick. I hope the JIT issues don't cause too much of a hit. Count me as among the people that would love to contribute to this project, I would be very interested in helping with adding audio support to this.

#18GDR! – Monday, October 11th 2010, 22:08

Phat idea. But aren't interpreters disallowed in AppStore?

#19codist – Tuesday, October 12th 2010, 00:41

I believe Unity3D 3.0 uses precompiled javascript so that must be possible.

#20Bob – Tuesday, October 12th 2010, 12:05

This was a really fun game! I hope the bundling of the CoreJS library works out for you!

#21Charle – Tuesday, October 12th 2010, 12:13

Yeah, I find it odd that Cisco didn't put up more of a fight then they did. I guess it wouldn't have been worth the negative PR it would have generated. You know Apple wouldn't have backed down.

#22Jazzi – Tuesday, October 12th 2010, 12:13

Remember there was a big hoopla when the iPhone was introduced because Cisco supposedly owned the rights to the name. Apple had a lot of balls using that name. They eventually worked something out with Cisco. Perhaps they worked with Cisco during the iOS renaming since they already had a relationship.

#23 – rudzon – Wednesday, October 13th 2010, 18:28

It would be cool, if you port it to Android too.
But, my iPod is still waiting for it :p

#24 – k – Friday, October 15th 2010, 10:51

The Editor is at

#25Peter – Saturday, October 16th 2010, 19:21

This combination is just what I was looking for since Jiggy is dead! Add native iPhone UI and the full featured game platform is done ;)

Good luck, Dominic!

#26Matt – Sunday, October 17th 2010, 21:30

What are your plans for licensing? Open source and free to all, or some sort of commercial license?

I absolutely cannot wait for this! Keep up the incredible work!

#27 – Jake – Monday, November 1st 2010, 05:38

The newest Apple developer EULA allows interpreters as long as the code that will be run is packaged with the app (i.e. not downloaded while the app is running).

#28 – Hovard – Tuesday, November 9th 2010, 23:26

Is there any solutions?

#29 – Hovard – Tuesday, November 9th 2010, 23:27

There some useful materials about iOS:

#30 – mother – Thursday, November 11th 2010, 20:26

I'm checking your site everyday for news on impactjs. I really want to try creating a game with your engine. I've never created a game before and the editor looks really great.

#31 – Handloomweaver – Sunday, November 21st 2010, 16:34

Is there any update on the 'whether you can make a browserless JavaScript game in iOS and have the app store accept it question?'

#32Marcos Zanona – Tuesday, November 23rd 2010, 12:39

Damn you're good!!!

#33 – mrdnk – Tuesday, November 23rd 2010, 22:33

Excellent, keep up the good work, when's it going to be ready for the web and iPhone?

#34 – Marcus – Tuesday, November 30th 2010, 15:48

I'm new to all this.
Could somebody explain how to make the JS run in a separate process and not have the browser handle it ?
Is the game still launched from the browser but the JS is handled externally via some other process ?
If so how do you declare that ? Is there some iOS specific markup to be used ?
Sorry to be so thick. I'm loving the discussion.

#35 – Marcus – Tuesday, November 30th 2010, 16:06


do I need to download WebKit and compile it up to run my JS exclusively ?

Or specify my JS as a parameter from the command line.

Presumably Canvas is lost so the call to the OpenGL-ES is essential with this approach.

Help ! :-)

#36 – sirrozha – Thursday, December 16th 2010, 00:04

why dont you publish it into cydia?

#37Forex trading guides – Saturday, January 22nd 2011, 03:06

I'm really eagerly waiting for this. Hope it's going to be free. Even if it's not, I'll pay for one.

#38shefix – Monday, February 21st 2011, 00:29

cool! :)

Post a Comment:

Comment: (Required)

(use <code> tags for preformatted text; URLs are recognized automatically)

Name: (Required)

Please type phoboslab into the following input field or enable Javascript. This is an anti-spam measure. Sorry for the inconvenience.