Don't use HOMEX,Y in SPHITSP
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user