Skip to content

Instantly share code, notes, and snippets.

@Joncom

Joncom/gist:5812191

Created Jun 19, 2013
Embed
What would you like to do?
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