Skip to content

Instantly share code, notes, and snippets.

@mloc
Created April 23, 2012 17:15
Show Gist options
  • Save mloc/2472402 to your computer and use it in GitHub Desktop.
Save mloc/2472402 to your computer and use it in GitHub Desktop.
var getDensityOnMap = function(checkx, checky)
{
var ciy = 0;
for(var mapstring in map)
{
var tmp = map[mapstring];
for(var cix = 0; cix < map[mapstring].length; cix++)
{
if((cix+1) == checkx && (ciy+1) == checky);
{
switch(tmp[cix])
{
case "W":
return 1;
case "F":
return 0;
case "S":
return 0;
}
}
}
ciy++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment