Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/twisterghost/heights-peak

A compiler from standardized JSON to JavaScript, runnable with the Heights.js game engine. No longer maintained.
https://github.com/twisterghost/heights-peak

Last synced: about 2 months ago
JSON representation

A compiler from standardized JSON to JavaScript, runnable with the Heights.js game engine. No longer maintained.

Awesome Lists containing this project

README

        

**This repo is no longer maintained, but was revived and edited in a redux branch. See what it would have looked like if it were made more recently [here](https://github.com/twisterghost/heights-peak/tree/redux).**

# Peak
A compiler for Heights

## What?

Peak is a system to take standardized JSON source files and generate full JavaScript files for the Heights game engine. Peak can minify and optimize the code, as well as include the Heights engine for a complete file which you can simply drop into a webpage.

Peak source files are not intended to be written directly, though it is entirely possible. The idea for Peak is to provide automation for code generation from an easily manipulatable standard, allowing applications to help generate Heights games. See the source spec further down in this README.

**NOTE: Peak is still in early, rapid development and is not intended for commercial use quite yet!**

## Usage
`node peak SOURCEFILE`

## Options
`-o, --out` Specify the output filename.

`-m, --min` Minify the output code.

`-f, --full` Include the Heights engine in the output file.

## Sourcefile spec
**NOTE: Peak is still in early development, this spec is NOT complete.**
```javascript
{
"variables" : {
"VARIABLE_NAME" : "VARIABLE_VALUE"
},
"objects" : {
"OBJECT_NAME" : {
"constructor" : "CONSTRUCTOR_CODE",
"functions" : {
"FUNCTION_NAME" : [
"FUNCTION_ARGUMENTS",
"FUNCTION_CODE"
]
},
"collisions" : {
"OTHER_OBJECT" : "COLLISION_CODE"
},
"inputs" : {
// For keyboad events
"INPUT_EVENT_TYPE" : ["KEY", "CODE_TO_RUN"],
// For mouse events
"INPUT_EVENT_TYPE" : "CODE_TO_RUN",
}
}
}
}
```