1
0

Don't use HOMEX,Y in SPHITSP

This commit is contained in:
otya128
2016-12-23 15:58:27 +09:00
parent 82781a9dd2
commit 7f5813d420

View File

@@ -149,8 +149,8 @@ struct SpriteCollision
{ {
if(sp.define && sp.col.mask & mask) if(sp.define && sp.col.mask & mask)
{ {
int x = (sp.linkx + sp.homex + sp.col.sx); int x = (sp.linkx + sp.col.sx);
int y = (sp.linky + sp.homey + sp.col.sy); int y = (sp.linky + sp.col.sy);
return detection(x, y, cast(int)(sp.w * sp.scalex), cast(int)(sp.h * sp.scaley)); return detection(x, y, cast(int)(sp.w * sp.scalex), cast(int)(sp.h * sp.scaley));
} }
return false; return false;
@@ -160,8 +160,8 @@ struct SpriteCollision
//(x,y,w,h)と判定 //(x,y,w,h)と判定
bool detection(int x, int y, int w, int h) bool detection(int x, int y, int w, int h)
{ {
int x2 = (data.linkx + data.homex + sx); int x2 = (data.linkx + sx);
int y2 = (data.linky + data.homey + sy); int y2 = (data.linky + sy);
if(x <= x2 && y <= y2 && x + w >= x2 && y + h >= y2) if(x <= x2 && y <= y2 && x + w >= x2 && y + h >= y2)
return true; return true;
int w2 = cast(int)(data.w * data.scalex); int w2 = cast(int)(data.w * data.scalex);