Skip to content

Instantly share code, notes, and snippets.

View cha0s's full-sized avatar
👌
Gettin' it

Ruben R cha0s

👌
Gettin' it
View GitHub Profile
// Requires ember.js and ember-data.js, socket.io
// Initializer for Models
window.Models = {};
var SOCKET = '/'; // Served off the root of our app
var ID = 'uuid';
var FIND = 'find';
var FIND_MANY = 'findMany';
@cha0s
cha0s / gist:3812609
Created October 1, 2012 15:47
Avocado Initial State example
# Avocado loads the 'Initial' state, and from there it's all up to you!
avo.States['Initial'] = new class
# Called the first time this state is loaded. You can set up any stuff your
# state needs here.
constructor: ->
# Yum, an avocado!
@avocado = {}
@cha0s
cha0s / gist:3811739
Created October 1, 2012 13:17
Avocado example State
# Avocado loads the 'Initial' state, and from there it's all up to you!
avo.States['Initial'] = new class
# Called the first time this state is loaded. You can set up any stuff your
# state needs here.
constructor: ->
# Yum, an avocado!
@avocado = {}
main = new MainBrowser()
main.initialize().then ->
Engine.state =
state: 'Environment'
args:
teleport:
environment: '/environment/browser-demo-kstown.environment.json'
roomIndex: 0
{
"traits": [
{
"type": "Existence"
},
{
"type": "Interactive",
"state": {
"rule": {
"name": "Interaction rule",
{
"uri": "/entity/npc/inside_npc1.entity.json",
"traits": [
{
"type": "Existence",
"state": {
"x": 256,
"y": 96
}
},
// argument = if (customValue = newCustomValue type)?
// V: [customvalue]
// else
// values = vicarValues entity, type
// I: [values[Object.keys(values)[0]].index]
// argument = if (customValue = newCustomValue type)?
// V: [customvalue]
// else
// values = vicarValues entity, type
// I: [values[Object.keys(values).shift()].index]
// if (customValue = newCustomValue type)?
// V: [customvalue]
// else
// values = vicarValues entity, type
// I: [values[Object.keys(values)[0]].index]
Handle<Object> argument = Object::New();
Handle<v8::Value> customValue = newCustomValue(type);
if (!customValue->IsUndefined()) {
// argument = if (customValue = newCustomValue type)?
// V: [customvalue]
// else
// I: [vicarValues(entity, type).shift().index]
Handle<Object> argument = Object::New();
Handle<v8::Value> customValue = newCustomValue(type);
if (!customValue->IsUndefined()) {
Handle<Array> a = Array::New();