Skip to content

Instantly share code, notes, and snippets.

@krawaller
Created June 30, 2010 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krawaller/459206 to your computer and use it in GitHub Desktop.
Save krawaller/459206 to your computer and use it in GitHub Desktop.
"plr-gate":{
conds: [{ // array of condition objects
'if': { // all properties here are conditions to be evaluated
"hasflag": "haskey" // tests for global flag of the given name
},
then: { // effects to take place if all conditions were true
on: true, // collision takes place on the square
stop: "b", // stops the marble motion, with animation "b" (bounce)
setwalltype: "none" // makes the gate disappear
},
'else': { // if any condition in if-object was false, execute this
stop:"b" // stop marble motion (on a neighbouring square, since object doesn't have prop on=true
}
}]
}, // ...
// part of propertylist of collision definition object
"plr-key":{
setwalltype: "none", // makes the key disappear
setflag: "haskey", // sets a global flag with the given name
on: true // collision happens when marble is on the square, as opposed to next to it
},
// ...more definitions...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment