iOS Games in JavaScript :)

Discussion in 'iOS Programming' started by vinivendra, Nov 24, 2015.

  1. vinivendra, Nov 24, 2015
    Last edited: Nov 25, 2015

    vinivendra macrumors newbie

    vinivendra

    Joined:
    Nov 24, 2015
    #1
    Hi all!

    (I'm new to the forum, so sorry if I'm doing the wrong thing in the wrong place. Also, I've been posting on a few forums, so sorry if you've seen this before.)

    I'v been working on a game engine that has a complete interface for JavaScript. It's essentially an abstraction layer on top of SceneKit, which tries to make everything more accessible to new programmers and developers. The app setup is quite simple (as of now, 5 lines of code in Swift) and after that the developer is able to write a complete game in a JavaScript file, which runs automatically.

    This idea was meant to make iOS game dev more accessible to people that have no experience with coding, but it ended up a bit more than that. It would be possible, for instance, to download a complete game off the internet and run it on the device, and by extension it makes it quite easy to supply updates etc.

    The project also includes a graphics editor for iPad, that tries to offer intuitive gestures for creating and editing graphics content, and a very accessible "for dummies" markup language used for representing the actual scene content.

    This engine is being developed as a university graduation project :D it's not exactly ready for public consumption (there's still a few things to round up, such as poor documentation and ugly UI) but it definitely works. I'd like to get your comments and impressions about the general concept before I submit it in a few days.


    I'll post a link to github if any one wants to check out the code (but I apologize in advance if I'm violating some sort of link or advertising policy in the forum :p)

    https://github.com/vinivendra/MAC0499

    Cheers!

    -- Edit
    There's a video presentation I created a while ago that demonstrates some of the project's features. The video is actually a screen capture of an app created using EngineKit, so it's all made of code and created using only JavaScript. The audio (unfortunately) had to be in portuguese, but it's not really relevant.

    Here are some images of a few scenes from the video (again, all created only in JavaScript):

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    I don't believe this violates any rules, but I feel like you should include some pictures or videos or some other demonstration of this. I'm a bit interested, but not enough to download that code and compile it and see what happens.
     
  3. vinivendra thread starter macrumors newbie

    vinivendra

    Joined:
    Nov 24, 2015
    #3
    Alright! I edited the original post to include a video and some images. I'm no 3D artist, this is just what I could do with the time I had :)
     
  4. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #4
    Looks neat! How does it compare with just using Three.js - seems like it may be simpler to just skip tying yourself into Apple's ecosystem at all and instead use Three.js, which runs in any modern browser (including iOS and Android's).
     
  5. vinivendra thread starter macrumors newbie

    vinivendra

    Joined:
    Nov 24, 2015
    #5
    The platform compatibility really is a disadvantage, but I think there are reasons to use this instead of Three.js.

    Firstly, I believe there would be a boost in performance (I haven't done any benchmarks, this is just reasoning): EngineKit is based on SceneKit, which has been optimized on top of Metal, a framework that is way lighter than Three.js's WebGL.
    Also, the game wouldn't be running on top of an internet browser, which eliminates some overhead.
    I've never used Three.js directly, but I have some experience with WebGL. Based on that, I'd also say there's a lot less JavaScript code being run in EngineKit; almost all of the work is done on native compiled languages, JavaScript is just there to call the right functions; it won't be used to handle as many calculations and data as it did when I used WebGL.

    Secondly, the fact that the final product is an app (not a webpage) may also be an advantage, depending on your goals. An app can be sold in the App Store, you can add in-app purchases, and it think it would be easier to hide your implementation (if you care about that).

    Finally, I took a look at Three.js and it does seem more complicated than EngineKit's interface. For instance, all the code in this post could be substituted by two lines of code in EngineKit's JavaScript

    car sphere = Sphere.create();
    sphere.color = "red";


    or in its markup language

    sphere Sphere
    color is red


    This is not only because EngineKit takes care of all the scene setup for the user, but also because it offers default configurations that usually work, instead of requiring the user to specify things like the vertex data for creating a sphere or the hex number for a color.
     

Share This Page