Quote:
Originally Posted by Starfire2001
PHP Code:
// assuming that your block's dimensions are 2x2
if (player.x in |this.x, this.x + 2| && player.y in |this.y, this.y + 2|) {
|
Just a note that you can use
this.width and
this.height to get the width/height of an NPC with a defined shape (like an image).