Patch to BobbleAnimation (which we don't seem to use anywhere) from nvanderh.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@87 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2006-12-05 06:25:23 +00:00
parent 562b1f11ab
commit 8286ef88c4
@@ -46,8 +46,8 @@ public class BobbleAnimation extends Animation
public BobbleAnimation (
Mirage image, int sx, int sy, int rx, int ry, int duration)
{
super(new Rectangle(sx - rx, sy - ry, sx + image.getWidth() + rx,
sy + image.getHeight() + ry));
super(new Rectangle(sx - rx, sy - ry, image.getWidth() + rx,
image.getHeight() + ry));
// save things off
_image = image;
@@ -74,8 +74,8 @@ public class BobbleAnimation extends Animation
// calculate the latest position
int dx = RandomUtil.getInt(_rx);
int dy = RandomUtil.getInt(_ry);
_x = (_sx + dx) * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
_y = (_sy + dy) * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
_x = _sx + dx * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
_y = _sy + dy * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
}
// documentation inherited