public boolean collidesWith(Sprite other) { // Really bad collision detection. return !mDestroyed && !other.mDestroyed && distanceTo(other) <= Math.max(mSize, other.mSize) + Math.min(mSize, other.mSize) * 0.5f; }
public float distanceTo(Sprite other) { return distanceTo(other.mPositionX, other.mPositionY); }
public float distanceTo(Sprite other) { return distanceTo(other.mPositionX, other.mPositionY); }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } return !isOutsidePlayfield(); }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } wrapAtPlayfieldBoundary(); return true; }
public void destroy() { mDestroyed = true; step(0); } }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } return !isOutsidePlayfield(); }
public boolean collidesWith(Sprite other) { // Really bad collision detection. return !mDestroyed && !other.mDestroyed && distanceTo(other) <= Math.max(mSize, other.mSize) + Math.min(mSize, other.mSize) * 0.5f; }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } wrapAtPlayfieldBoundary(); return true; }
@Override public void destroy() { super.destroy(); crash(); } }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } wrapAtPlayfieldBoundary(); return true; }
@Override public void destroy() { super.destroy(); crash(); } }
public boolean step(float tau) { mPositionX += mVelocityX * tau; mPositionY += mVelocityY * tau; if (mDestroyed) { mDestroyAnimProgress += tau / getDestroyAnimDuration(); if (mDestroyAnimProgress >= 1.0f) { return false; } } return true; }
@Override public boolean step(float tau) { if (!super.step(tau)) { return false; } wrapAtPlayfieldBoundary(); return true; }
public boolean step(float tau) { mPositionX += mVelocityX * tau; mPositionY += mVelocityY * tau; if (mDestroyed) { mDestroyAnimProgress += tau / getDestroyAnimDuration(); if (mDestroyAnimProgress >= 1.0f) { return false; } } return true; }
public void destroy() { mDestroyed = true; step(0); } }