
06-15-2014, 10:47 AM
|
|
Registered User
|
Join Date: Aug 2011
Posts: 83
|
|
Quote:
Originally Posted by Jakov_the_Jakovasaur
something like this?
PHP Code:
function isBlocking(tile) {
temp.blocktiles = {0,16,1024,1025,1026,1027,1028,1029};
return
tiles[player.x + 1.5, player.y + 2] in temp.blocktiles ||
this.checkBlockNPCs()
;
}
function checkBlockNPCs() {
temp.npcs = findareanpcs(player.x + 1.5, player.y + 2, 0.0625, 0.0625);
for (temp.n : temp.npcs)
if (temp.n.blocking)
return true;
return false;
}
but then im not sure its a good idea to be checking just a single pixel for collisions, graal movement usually checks the width of the players body (2 tiles or 32 pixels)
|
What are the 0.0625s for? |
|
|
|