Updates: Touch Controls, API Additions, Teacher’s Notes, New Compiler and More

Posted: by Seb under Play My Code Announcements

Apologies for not posting for so long: we’ve been very busy working on a whole host of improvements and additions to Play My Code. Not to mention we’ve been presenting some talks about PMC, are preparing to open source some of our underlying tech, have some teacher’s notes to share and much more. Full details below…

Experimental Touch Controls Added

We’ve begun adding touch controls to Play My Code. Currently an experimental feature, a single touch is available which emulates the mouse- but even at this early stage, most mouse-driven PMC games are now playable on an iPad or iPhone, including Wacky Cannon, Oroubo Ware, Spike Dislike, Colourbreak and many more. Merely adding mouse controls should make your game touch compatible, so long as you don’t rely on the mouse buttons too much!

We’re also working on touch equivalents for button presses, multitouch and more, whilst hopefully we’ll get it working on Android at some point too (thanks krakatomato for testing this for us!). Meanwhile, we’ll also have some documentation and perhaps even a tutorial post about adding touch soon.

Play My Code at Mobile Monday & Hydrahack

Recently we gave two show & tells about Play My Code, the first taking place at Mobile Monday Birmingham on Monday 30th April at Faraday Wharf, Birmingham Science Park. We gave a talk about PMC in general in front of an audience of 130 developers, entrepreneurs and general industry types before revealing Play My Code’s added touch functionality, mere hours after its implementation. Those who are interested can find some photos from the event here.

Our second talk was slightly more informal, yet no less exciting: taking place at Hydrahack, a meetup for Birmingham web developers. We demoed PMC’s features, and even live-coded and released a small demo to showcase the ease Play My Code offers in terms of both development and deployment. Again, find some photos right here.

Play My Code Intro Notes for Teachers

Tim Scratcherd of the School House Partnership was kind enough to share some notes he’d put together which provide an intro to Play My Code for teachers who might be new to PMC, or even computer science in general. Centred around our Bombs ‘n’ Booty tutorial, the notes provide general introduction and guidance plus code samples intended for educators. If you’re a teacher currently using PMC in the classroom then please check them out, and do get in touch should you need any help or advice.

API Additions

We’ve made a few minor additions to the Play My Code API.

First off, String.toInt() and String.toNumber() are functions which make converting numeric strings easier. As you might guess, toInt() will only return a whole number, whilst toNumber() will return either whole or decimal numbers and also works with hexadecimal.

String.split() is a function which splits a string into an array. A given separator is used to determine where to split the string.

Finally, Array.includes() returns true if an array contains a given element.

Click the respective function, above, to read more details about it in the docs.

Play My Code Player Improvements

You may or may not have noticed that we’ve buffed and shined the Play My Code game player: games can now be shared on Facebook and Twitter straight from the menu bar. Check it out, let us know what you think, and get sharing.

Coming Soon: New Compiler

A lot of our time over the last few months has gone into into rebuilding our language compiler. It’s not yet quite complete, but the worst is behind us. The current compiler uses a library called JS/CC- excellent for getting our language built quickly, but over time it’s ended up holding us back. Adding new syntax is somewhere between difficult and nightmarish, but the new compiler addresses this- making it easier for us to add improvements. Once it’s in expect to see modules, mixins and other improvements finally cropping up.

A change that users will also see straight away is that syntax error messages are drastically improved!

Open Sourcing

We recently open sourced SkyBrush, the painting app which features as part of our IDE. We use a lot of open source technology here, so we’d like to give back to the community and offer up some of the cool things we’ve been building. Go checkout SkyBrush on GitHub if you want a painting application for your own site.

After SkyBrush, we also plan to open source our Quby language, plus the parser building library too. We’ve had a lot of people asking about using it for scripting in their own projects, as there aren’t many languages out there which compile to JS while offering sandboxing. We will announce when a stable version is online, so watch this space.

Finally, for those of you who do web development: we have a complete PHP MVC framework that we built for PMC, called Flexi. We built it as it allows us to do more with less code – and less configuration – than some of the other (still awesome) frameworks out there. Just like our other tools, there is no reason why we should be the only ones taking advantage of this.

Anyway, til next time… Follow @playmycode on Twitter for the very latest news.

3 Responses to Updates: Touch Controls, API Additions, Teacher’s Notes, New Compiler and More


I observed some new API additions in the Docs, which I personally have not seen them before, and seems that they are not listed in this blog post or in any previous one.


Which ones Giorgio? To be honest it's pretty likely that some things might have been added which we've not posted about. Anything major should end up being mentioned on the blog though.

Andy White

Thanks for the update! Some great work you guys are doing and I can't wait to try out the new compiler/editor :) There's a few API additions I'd like to see, but considering the compiler changes I'll wait to mention them as you're clearly very busy! (ok, just one that I might mention - 'context.clip()' so I can define a clipping region to avoid "textures" being drawn outside this of it :D

Leave a Response

Your email address will not be published. Required fields are marked *