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
| // A* path finding algorithm for impactjs game engine | |
| // adapted from http://stormhorse.com/a_star.js | |
| // via http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html | |
| // impact-ified by jminor - http://pixelverse.org/ | |
| /* Example: | |
| this.pathFinder = new PathFinder(); | |
| var start = [((this.pos.x+this.size.x/2) / tilesize).floor(), ((this.pos.y+this.size.y/2) / tilesize).floor()]; | |
| var destination = [((target.pos.x+target.size.x/2) / tilesize).floor(), ((target.pos.y+target.size.y/2) / tilesize).floor()]; |
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 assert = require('assert'); | |
| var net = require('net'); | |
| var open = process.binding('fs').open; | |
| var sendfile = process.binding('fs').sendfile; | |
| if (process.argv.length < 4) { | |
| console.error('usage: sendfile <port> <path>'); | |
| process.exit(1); | |
| } |
NewerOlder