ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
363 stars 75 forks source link

Code reuse and a question #59

Open pajtai opened 12 years ago

pajtai commented 12 years ago

Can reuse existing method logic instead of recreating them in inverse, and is there a reason that item.rect().width and item.rect().height is not taken into account for isRightOf and isBelow? ..... This question extends to forceInside?

So basically, the only reason I noticed the code reuse issue is that I was trying to understand why I had to adjust by the width of the sprite to check if the player was to the right of the viewport but not to the left... So my question is, feature or bug?

BorisKozo commented 11 years ago

I think that after your change the function checks isIntersects and not isInside