Skip to content

Instantly share code, notes, and snippets.

@Joncom
Created June 19, 2013 07:02
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 Joncom/5812191 to your computer and use it in GitHub Desktop.
Save Joncom/5812191 to your computer and use it in GitHub Desktop.
Count entities player is touching
var count = 0;
for(var i=0; i<ig.game.entities.length; i++) {
if(ig.game.player.touches(ig.game.entities[i])) {
count++;
}
}
console.log(count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment