Friday, January 13, 2012

monkey demo, install and run

If you want to code 2D video games in HTML5 or any other target for that matter, monkey provides a simple fun environment where you can get your game design on. 

Monkey code is easy to read, clean with a pleasing modern programming design.

Write code in monkey once and then let it produce efficient translations into 5 other programming languages hosted on no less than 7 different target computing devices.

The following is a step by step install and go style tutorial for the monkey demo. The monkey demo, is in fact a free, unrestricted, powerful programming environment for HTML5 development.


At http://monkeycoder.co.nz, locate the huge DOWNLOAD button at the top right of the site. This takes you directly into the shop which is where you download the absolutely free Monkey development system with HTML5 target included.


The demo is currently 45C a particularly stable version of the monkey language with interfaces and generics language additions and an HTML5 server daemon named mserver.


Monkey is distributed as a single portable folder inside a zip archive. 


If you are simply evaluating monkey, expand the folder onto your desktop.

Monk is the free code editor for Monkey and is distributed with both MacOS and Windows versions in same folder.


Blitz Research does not sign their tools so if you have downloaded the demo from the official site as instructed above, untick the "Always ask before opening" box and run the monk editor.


Instead of reading the manual, go straight to the bananas folder inside monkey in the treeview on the right. This folder contains a number of samples contributed by the original beta testing crew in particular the mak folder where the author of the monkey language Mark keeps his tests and examples.

Selecting the bouncingaliens.monkey file should load the source code into the editor. 

Clicking on the spaceship or pressing the F5 key should build and run the source code.


More permissions are required so that monkey's internal web server can run and communicate with your HTML5 web browser (IE9 and above, Chrome, Safari, FireFox etc.).





After building the bouncy aliens demo you can Refresh the folder view to explore the newly created .build folder that monkey has created.


Those with existing html5 skills can modify the games .html container. There are some dependencies between a .build folder created by monkey and the monkey version. When upgrading to newer versions of monkey, be prepared to move or backup then delete the .build directory structure monkey maintains in your game's source folder.



The Code tab of the monk tree view allows you to navigate a program.

A standard monkey app such as bouncyaliens uses the mojo app framework to update its inputs and then render its outputs.

Unlike other environments keyboard and other input is only valid in the applications OnUpdate method.

Likewise the mojo drawing commands are only valid during an apps OnRender.

TBC