Huge Update: Painter, Full Screen IDE, Optimisations and More

Posted: by Seb under Play My Code Announcements

Hello! We’re back, with a major addition to Play My Code which cements its position as a one-stop-shop for browser game creation, as well as a usual collection of slightly more minor language refinements, bugfixes and optimisations.

Integrated Painting Application

Play My Code Integrated Painting Application

Play My Code’s suite of tools now includes a full, integrated art package for creating and editing assets, meaning those of you not lucky enough to have access to decent graphic tools can now create assets directly in your browser.

The art package – known simply as ‘Painter’ – is fully-featured and comes with a variety of graphic tools including brushes, primitive shapes, undo/redo and zoom, whilst assets of any dimensions can be created and edited.

Painter can be found in the IDE, via the assets pane- you should notice the addition of a New button next to the existing image upload tools, whilst there are also controls to edit any uploaded assets. Once inside, you can create, edit and save assets to your heart’s content. The tools should be pretty familiar to anyone who’s used a basic art package, plus don’t forget you can try the IDE and Painter without even signing up for an account.

We hope you find this new addition useful and inspirational. We intend to keep adding & refining features over time, and would love to know your thoughts- please leave any feedback, problems and suggestions in this forum thread right here.

Fullscreen IDE

We’ve made a much-requested improvement to our IDE: the code area now expands, to fill the otherwise empty space at the sides on large monitors. Hopefully writing code should now feel a bit less claustrophobic.

Play My Code on Facebook

Play My Code now has a Facebook page, at Check it out & give us a like!

API Additions

As usual, we’ve made a number of additions & refinements to the API.

Easier 2D Arrays

As requested on our forums, we’ve made some changes to the way 2D arrays are created. It’s now as easy as this:

grid = new Array( width, height )

A new fill method for the array, to replace all, or just some, of the elements already contained within the array. It can also be useful for padding an array out with a new element.

ns = [ 1, 2, 3, 4, 5 ]
ns.fill( 6 )

// prints out [ 6, 6, 6, 6, 6 ]
console( ns )

Find more info about arrays in the Array Class documentation.

Blocks for Mouse Click & Down

When you check if the mouse button is clicked or down, it’s common to also want to check the mouse location. To make this a little easier, you can now attach a block onto isLeftClick, isMiddleClick, isRightClick, isLeftDown, isMiddleDown and isRightDown. In all cases, the block is only called if the method would return true (if the mouse is clicked or down), and passes the mouse x and y location into the block.

/* Moves the player to the current mouse location,
 * when the mouse button is down. */
getControls().isLeftDown() do |x, y|
    player.setLocation( x, y )

More information about everything to do with mouse control can be found in the Controls Class documentation.


You can now retrieve the mouse x &amp y location using a block, via the getMouseXY method:

getControls().getMouseXY() do |x, y|
    // use the x and y location here

More info about this can be found here.


Play My Code is quicker than ever before, thanks to a load of optimisations and improvements. Amongst other improvements, image tinting is now around 6 times faster than it was before, whilst speed has improved across the board when playing PMC games in Google Chrome.

That’s about it for now: as ever, feel free to drop us a line if you have any feedback or suggestions on the above or any other aspect of Play My Code. Leave a comment on this post, drop us a line via the forums or send a tweet to @playmycode on Twitter. See you soon, and happy coding!

Leave a Response

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