Skip to content

Go Everywhere Project format

Philip Rader edited this page Aug 16, 2013 · 3 revisions

THIS FORMAT IS NO LONGER USED! We will be using Scratch 2.0 format, which is fairly simple. The project file is a zip, and inside the zip is a project.json, which holds all the project info. The zip also contains sounds and images. The extension will still be .ge however.

Please take into consideration that the format of the project can change at ANY time. Check back here to get the most recent official documentation on the format.

Go Everywhere has it's own unique format for saving projects. It is structured as an XML document. Each project has the extension .ge (Ex. test_project.ge). For the actual structure of the document, it starts with a header for both XML and GE.

<?xml version="1.0" ?>
<goev version="1.0">

</goev>

The tag is what holds the project, and the version number is the version of the project format, NOT the version of Go Everywhere itself. After the <goev> tag comes the project info. It is a single element <info> tag, with the parameters title, description, creator, and thumbnail. All of the parameters are optional, but it is highly recommended that the title parameter has a value:

<info title="%PROJECT_TITLE%" description="%PROJECT_DESCRIPTION%" creator="%PROJECT_CREATOR%" thumbnail="%DATA_URI%" />

The parameters title, description, and creator are pretty much self explanatory. The thumbnail parameter must be a data image URI. You can convert an image to a data image URI using a handy converter I found. After the <info> tag, comes the <project> tag. The project tag holds the stage scripts, sprite scripts, and anything that goes along with the project in a similar way:

<project>

</project>

Inside the <project> tag, comes the <stage> and <sprite> tags. Preferably, the <stage> tag comes first, but it doesn't really matter the order. We will talk about the <stage> tag first. The <stage> tag has no parameters, and holds three types of tags: <costume>, <sound>, and <script>. We will talk about <script> tags later. The <sprite> tag has one parameter that is currently not required. The <sprite> and <stage> tag's interior are identical, so we can talk about them both. Inside a <sprite> or <stage>, comes the <costume> tag, and the <sound> tag.

<costume name="costume1" data=%DATA_URI%" />
<sound name="sound1" data=%DATA_URI%" />

As with the project thumbnail, you need to have the data URI, which you can convert using this wonderful converter I found. The costume tag can also have one more additional parameter. If you have the parameter "current", with the value "yes", then it selects that costume as the current costume the sprite/stage is on. The "current" parameter IS NOT REQUIRED. However, the name parameter IS required!! Another thing to note is that the <stage> tag uses <costume>, not <background>, so that we can reuse a little code.

The <script> tag

The <script> tag gets its own section, because it is very complex. The <script> tag represents a stack of blocks, with or without a hat, in a <sprite> or the <stage>. The actual node looks like this:

<script>

</script>

HOWEVER, if you want a hat block, add the appropriate block name to the "name" parameter:

<script name="greenFlagClicked">

</script>

AND, if you have a hat block that takes a parameter, such as the "When % Key Pressed" block, put the parameter value in the "value" parameter on the tag:

<script name="keyPressed" value="space">

</script>

Inside the <script> node comes the <block> tag. The <block> tag is structured like this:

<block type="%BLOCK_SPEC_TYPE%" name="%RESPECTIVE_BLOCK_NAME%">

</block>

The %BLOCK_SPEC_TYPE% is the block spec letter for telling what shape the block is:

- ~ Command (stack) block

c ~ C-shape block

t ~ Time block (Like the "wait (1) seconds" block, where it pauses the script)

r ~ Reporter block

b ~ Boolean block

An example block would be:

<block type="-" name="resetTimer">
</block>

However, most blocks take one or more parameter. IF a block has a parameter, you use the &l;param> tag INSIDE of the &l;block> node:

<block type="t" name="waitSeconds">
<param type="%PARAM_TYPE%">
%PARAM_VALUE%
</param>
</block>

The %PARAM_TYPE% is the type of parameter is is. This can be either "text", "number", or "block". If it is equal to "text" or "number", you put the value of the constant where the %PARAM_VALUE% is. IF it is equal to "block" however, then you can put another block there (a reporter type, to be specific). Then, the pattern repeats with THAT block. You can have multiple <param> tags, but note that they are read in order, displaying left to right on the block's parameters. ABOVE ALL THAT, C-shape blocks are a tad different than other blocks. Because they hold blocks, and can have parameters themselves, you combine the two:

<block type="c" name="if">
    <param type="block">
        %IF_STATEMENT_BLOCK_PARAMETER%
    </param>

    <block type="-" name="resetTimer">
    </block>
</block>

Just to make it easier on yourself, you can separate the <param> node and the <block> nodes with an extra line.

If you want an example project file, I converted https://dl.dropboxusercontent.com/u/79521154/GoEverywhere/1.sb into https://dl.dropboxusercontent.com/u/79521154/GoEverywhere/1.ge (Scratch 1.4 format to Go Everywhere Project format).