This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var applyFn = function(node, fn) { | |
var applied = fn(node); | |
return applied === undefined ? node : applied; | |
}; | |
var macro = function(key, val) { | |
if (key.firstBit === repeatChild) { | |
repeatChild(key, val) | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aliens = [{}, {}, {}]; | |
var aliensCollidingWithPlayer = []; | |
for (var i = 0; i < aliens.length; i++) { | |
if(colliding(alien[i], player)) { // is colliding current tick | |
var collidingInPreviousTick = false; | |
for (var j = 0; j < aliensCollidingWithPlayer.length; j++) { | |
if (aliens[i] === aliensCollidingWithPlayer[j]) { | |
collidingInPreviousTick = true; | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = new Snowflake(); | |
s.aSnowflakeFunc(supportingVar, actionFunc(arg) { | |
// do stuff in here. | |
}, arg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
identifier: "idle", strategy: "prioritised", | |
children: [ | |
{ | |
identifier: "spot", strategy: "sequential", | |
children: [ | |
{ identifier: "callRange" }, | |
{ identifier: "stopSpotting" }, | |
] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var landscape = new Landscape(); // one actor | |
// make instance of Machine and get the root nodes for each actor | |
var machine = new Machine(); | |
landscape.state = machine.generateTree(landscapeJson, landscape); | |
// every second, something happens in the ecosystem | |
setTimeout("step()", 1000); | |
var step = function() { | |
// trigger the next state transition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking for program gcc or cc : /usr/bin/gcc | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for node path : not found | |
Checking for node prefix : ok /usr/local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If dustbin is colliding with a girl | |
If she is moving through the left side of the dustbin | |
Move the dustbin horizontally so its left side is touching the girl's right | |
If she is moving through the right side of the dustbin | |
Move the dustbin horizontally so its right side is touching the girl's left |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For each tick of the clock | |
For every object in the game | |
Get all the other objects in the same grid square | |
For each other object in the same grid square | |
If object still wants to hear about square sharers in this tick | |
Tell the object there is a potential collision | |
If the object's bounding box overlaps the other's | |
Object reacts | |
Object indicates if it wants to hear about more square sharers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make a structure to hold all the grid squares | |
For each grid square | |
Make a grid square container | |
// Put all the objects in the right grid square container | |
For each object in the world | |
Get the object's x and y coordinates | |
Determine which grid square the coordinate falls into | |
Add the object to that grid square container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make a structure to hold all the grid squares | |
For each grid square | |
Make a grid square container | |
// Put all the objects in the right grid square container | |
For each object in the world | |
Get the object's x and y coordinates | |
Determine which grid square the coordinate falls into | |
Add the object to that grid square container |