Crayon

AboutTutorialsDocumentationDemosDownloadSource
What is Crayon like?
How does Crayon work? Like...is it translated? Compiled?
What does Crayon code look like?
Why have you done this?
But aren't native apps still useful for certain cases?
Why were C#, JavaScript, Java, and Python chosen? Why no mobile?
Are there any text editors that support syntax highlighting for Crayon?
I found a bug. How do I get you to fix it?
I'm a PyGame user. Should I use Crayon instead?
I'm an HTML5/Canvas/JS user. Should I use Crayon instead?
I'm a Unity user. Should I use Crayon instead?
I've written a cool game in Crayon. How do I add it to the demos page?
Who are you?

What is Crayon like?

It's actually quite a bit like what Python would look like if:

How does Crayon work? Like...is it translated? Compiled?

Your code is compiled into a byte code. The VM, which is actually written in Crayon itself, is translated into various languages and platforms and interprets your byte code on that platform. This ensures that your code will behave identically on all platforms.

What does Crayon code look like?

Here's a simple open source game I wrote at a 2-day game jam where you play a tuna sandwich that's become sentient that needs to eat the other food in the fridge to grow big and escape.

Why have you done this?

Asking a user to download your game as a zip file which includes either natively executable code or some other format that requires more downloads isn't as universally acceptable as it was many years ago. Most operating systems, browsers, or virus scanners, will rightfully think they're under attack when native code is downloaded and executed. Most app and game distribution occurs in some sort of app marketplace or via the web. Flash was the answer for web games from the late 90's for about 10 years, until HTML5 and Canvas became a viable platform for games and Flash continued to be plagued by security vulnerabilities.

Being able to quickly write games in a Python-like language that ran in the browser without a plugin but not being JavaScript was the trigger that set this in motion.

Additionally being able to write games now that could be instantly ported to mobile in the future when the addition of mobile platforms is completed was also important.

But aren't native apps still useful for certain cases?

Yes. And you can still create native apps in Crayon using the C# export. The driving philosophy of Crayon is to not block people into one particular platform.

Why were C#, JavaScript, Java, and Python chosen? Why no mobile?

Crayon is still relatively new. Mobile support is highly desired and currently in the works. Android, iOS, and even Windows Phone are very important markets. Here's the reasoning and history of each of the 4 currently supported platforms:

Are there any text editors that support syntax highlighting for Crayon?

I have written a Notepad++ syntax highlighter definition. However, because Crayon is a basic curly brace language, associating the .cry file extension with your favorite text editor's C#, Java, JavaScript, or C++ syntax usually gives a fairly decent experience.

I found a bug. How do I get you to fix it?

Report it in the issue tracker on GitHub. If you don't have a GitHub account, send an email to the mailing list and then ask yourself the troubling question of why you don't have a GitHub account by now.

I'm a PyGame user. Should I use Crayon instead?

For most use-cases, yes. The number of features supported by PyGame that are not supported by Crayon is shrinking considerably with each release. If you already know Python and some other curly brace language, the learning curve is virtually non-existent. PyGame was the main inspiration behind most of the built-in Crayon library.

I'm an HTML5/Canvas/JS user. Should I use Crayon instead?

Probably. It depends on how much you dislike JavaScript and how much of the canvas API you're making use of. If you're drawing geometric primitives and images, then you may find Crayon a bit more friendly than raw JavaScript. If your only motivation for using JavaScript to make games is to avoid requiring useres to have specific browser plugins, then Crayon may be an ideal alternative to JavaScript, particularly if you are disatisifed with JavaScript's prototype-based Object Oriented model and other various quirks. Because Crayon is a VM+ByteCode, there's no need to worry about cross-browser compatibility.

I'm a Unity user. Should I use Crayon instead?

Depends, but probably not, as the target use-cases are generally different. Crayon is currently 2D only and, while it supports many platforms, it doesn't target all of them, yet (although hopefully this will change). But if you're a Unity 2D user and are trying to make a game that you want people to be able to play in a browser and are tired of people downloading a plugin, then perhaps. Some of the benefits of Crayon over Unity are:

I've written a cool game in Crayon. How do I add it to the demos page?

Feel free to reach out on the mailing list. Or tweet it to me. Or use the IRC channel. Several communication channels are listed on the community page.

Who are you?

My name is Blake. I like to make games.